I have several modules - let\'s say server.js, module1.js,...,moduleN.js.
I would like define the log file in my server.js:
winston.add(winston.trans
I am working on Winston 3.0.0 right now. And it seems the way to configure the default logger has changed a little bit. The way that works for me is folloing:
log.js// the setting for global logger
const winston= require('winston');
winston.configure({
level:"debug",
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple()
),
transports: [
new winston.transports.Console()
]
});
The other part is the same.
In the beginning of you application, require('log.js'), and also require ('winston'),
While in all other files, simply require('winston')
.