bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
795 stars 187 forks source link

error logger quits on unhandled exception #246

Open ronyeh3 opened 4 years ago

ronyeh3 commented 4 years ago

referring https://github.com/bithavoc/express-winston/issues/195

please have a look again we're just want to expressWinston.errorLogger to have handleException: true , but without process.exit(1)

please see in \winston\lib\winston\exception-handler.js line 170

let doExit = typeof this.logger.exitOnError === 'function'
? this.logger.exitOnError(err)
: this.logger.exitOnError;

doExit always have a true value, regardless setting exitOnError:false

should add the exitOnError flag to errorLogger constructor option