I'm using Winston in my nodejs application.
const winston = require('winston');
const logger = winston.createLogger({
transports: [
new winston.transports.Console()
]
});
logger.info('What rolls down stairs');
I want to add to the log correlation id, but I do not want to write every time
logger.info('What rolls down stairs', correlationId);
I want to Winston to do that. and for every log I want to get the correlationId as result of the function so I can send the correlationId to the user (not just output it to the console).
const correlationId = logger.info('blabla')
Is it possible to do that with Winston?