Closed James-Firth closed 7 years ago
No, you're not missing anything obvious. It is possible—just not obvious. The trick is to use two request loggers:
app.use(expressWinston.logger({
transports: [new winston.transports.Console()],
meta: false
}));
app.use(expressWinston.logger({
transports: [new winston.transports.File({filename: 'somefile.log'})],
meta: true
}));
My day job has been running multiple loggers like this for almost 2 years without issue.
Ah that makes sense, thanks for the information!
I'll be implementing that for my day job as well on Monday.
Thanks again!
Please correct me if I'm missing something obvious.
I'd like to enable the meta-data logging on my verbose/error logging but only on the file transport. On the console transport I'd still like a clean metadataless log.
I don't believe this is possible currently is it? If not, I'd like to request this feature!
Thanks!