I want to flush the winston logger before process.exit.
process.on(\'uncaughtException\', function(err){
logger.error(\'Fatal uncau
Winston actually allows you to pass in a callback which is executed when all transports have been logged:
process.on('uncaughtException', function(err) {
logger.log('error', 'Fatal uncaught exception crashed cluster', err, function(err, level, msg, meta) {
process.exit(1);
});
});
Docs: https://github.com/flatiron/winston#events-and-callbacks-in-winston