-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
winston-fileIssues to move to `winston-file` when we create itIssues to move to `winston-file` when we create it
Description
Please tell us about your environment:
winstonversion?-
winston@2 -
winston@3
-
node -voutputs: v10.10.0- Operating System? (Windows, macOS, or Linux)
- Language? (all | TypeScript X.X | ES6/7 | ES5 | Dart)
What is the problem?
File transport is not flushing on exit. Even when flushing per https://github.com/winstonjs/winston#awaiting-logs-to-be-written-in-winston
Steps to reproduce:
'use strict';
let winston = require('winston');
// VERSION: "winston": "^3.1.0",
let file_transport = new winston.transports.File({
filename: `${__dirname}/myfile.log.json`,
});
let logger = winston.createLogger({
transports: [file_transport],
});
async function run() {
for (let i = 0; i < 1000; i++) {
logger.info('message');
}
logger.info('THE LAST MESSAGE');
await new Promise(resolve => {
file_transport.on('finish', resolve);
logger.end();
});
process.exit(1);
}
run();What do you expect to happen instead?
all messages (including THE LAST MESSAGE) should be written to the file.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
winston-fileIssues to move to `winston-file` when we create itIssues to move to `winston-file` when we create it