Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
new winston.transports.Console({})
],
}));
const logger = winston.createLogger();
// Logger with minimum options (winstonInstance)
app.use(expressWinston.logger({
winstonInstance: logger,
}));
// Error Logger with all options
app.use(expressWinston.errorLogger({
baseMeta: { foo: 'foo', nested: { bar: 'baz' } },
dynamicMeta: (req, res, err) => ({ foo: 'bar' }),
format: new Format(),
level: (req, res) => 'level',
metaField: 'metaField',
msg: 'msg',
requestFilter: (req, prop) => true,
requestWhitelist: ['foo', 'bar'],
transports: [
new winston.transports.Console({})
]
}));
// Error Logger with min options (transports)
app.use(expressWinston.errorLogger({
transports: [
new winston.transports.Console({})
],
}));