express-bunyan-logger
express-bunyan-logger copied to clipboard
Don't mutate options
The passed in options are mutated by express-bunyan-logger
. That doesn't work well when you want to share config settings between the standard and error logger.
https://github.com/villadora/express-bunyan-logger/blob/master/index.js#L30
Mutation breaks the following use-case:
var options = { format: ':res[statusCode] :method' };
app.use(logger(options));
...
app.use(logger.errorLogger(options));