Open nengine opened 7 years ago
Do you have winston version 3.0.0 ? It looks like this module is not compatible with it, only with winston 2.x
Hi,
Check this example:
var winston = require('winston');
var Rotate = require('winston-logrotate').Rotate;
var rotateTransport = new Rotate({
file: __dirname + '/log/debug.log',
colorize: false,
timestamp: true,
json: false,
size: '10m',
keep: 5,
compress: true
});
var rotateTransportException = new Rotate({
file: __dirname + '/log/exceptions.log',
colorize: false,
timestamp: true,
json: false,
size: '10m',
keep: 5,
compress: true
});
var logger = new (winston.Logger)(
{
transports: [
new (winston.transports.Console)({ json: false, timestamp: true }),
rotateTransport
],
exceptionHandlers: [
new (winston.transports.Console)({ json: false, timestamp: true }),
rotateTransportException
],
exitOnError: false
});
for (var i = 0 ; i < 10; i++)
{
logger.info('Lapis Lapis Lapis Lapis Lapis Lapis Lapis Lapis Lapis Lapis Lapis Lapis Lapis ', i);
}
Note: This project needs a new maintainer as I am no longer actively developing or using this.
Same issue
Could you help me see what I might be doing wrong here? Thanks.