I want to flush the winston logger before process.exit.
process.on(\'uncaughtException\', function(err){
logger.error(\'Fatal uncau
Unfortuantely, Winston will sometimes call the logging callback before the transport has had a chance to flush, so the accepted answer can still lead to un-saved log messages (especially on the first turn of the event loop). A better solution is implemented in the winston-log-and-exit package / patch.