Open mountaindude opened 2 years ago
Example
logTransports.push(
new winston.transports.Console({
name: 'console',
level: config.get('Butler.logLevel'),
format: winston.format.combine(
winston.format.errors({ stack: true }),
winston.format.timestamp(),
winston.format.colorize(),
winston.format.simple(),
winston.format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`)
),
})
);
The logging module of Butler CW does not currently handle error logging as well as it should. Specifically, in some cases there is no stack trace or error message when errors occur.
This can be easily fixed by adding the following to the Winston.createLogger call:
winston.format.errors({ stack: true })