Open temas opened 12 years ago
The following test code shows that if process.exit() is called, log output may be lost. In this case, it doesn't even create the file(!). Commenting out process.exit makes it work properly.
var winston = require('winston');
var logger = new (winston.Logger)({ transports: [ new (winston.transports.File)({'filename': '/tmp/test.log'}) ]});
logger.info('test'); process.exit(1);
The combination of these two commits should help a bit, but there are still other places where we process.exit() which probably need to be audited.
commit 0f0b8751409f42c5324c364e98ffefd20ae3e249 Author: Matt Zimmerman mdz@singly.com Date: Wed Jan 11 18:42:09 2012 -0800
If a global migration fails, attempt a clean shutdown instead of bailing hard
commit 50d0e9033b8e357b79fb1f1ca3aacee1385c4e30 Author: Matt Zimmerman mdz@singly.com Date: Wed Jan 11 18:08:34 2012 -0800
Ensure that log output is flushed before (clean) shutdown
The winston callback stuff isn't working as intended, unfortunately
There's a potential that some logs are getting to stdout but not to the file log when enabled. This needs to be investigated, and is possibly at the winston level.