Closed Enado95 closed 4 years ago
Have you tried the dynamicMeta: function(req, res) { return [Object]; }
option?
I am using it to write the unique request Id to the logs:
app.use(expressWinston.logger({
transports: [
new winston.transports.File({
....
}),
],
format: winston.format.combine(
winston.format.timestamp(),
winston.format.json(),
),
dynamicMeta: function(req, res) {
return { reqId: req.id };
}
}));
Thanks I'll check it out
This works. Thanks for the assistance @dezoito
Is there an option to add customer field?
Like for example I want to add a username field to see made the request to me api.
I already have in the msg like this:
But its quite challenging to search.