const options = {
level: 'info',
filename: path.join('gis-service.log'),
maxSize: 500,
// maxFiles: 5,
logstash: true,
tailable: true,
// zippedArchive: true,
handleExceptions: true
};
const consoleOptions = {
level: 'info',
colorize: true,
timestamp: true
};
const logger = winston.createLogger({
level: 'info',
format: winston.format.combine(
winston.format.timestamp(),
winston.format(function dynamicContent(info, opts) {
info.message = info.message;
return info;
})(),
winston.format.simple()
),
transports: [
new winston.transports.File(options),
new winston.transports.Console(consoleOptions)
],
exitOnError: false
});
logger.stream = {
write: function(message, encoding){
logger.info(message);
}
};
This is my config, but file already is 12 KB and new file hasn't created.
Help me, please :).
Any Solution for this??
Isn't it maxsize?
Sorry :)
const options = {
level: 'info',
filename: 'luluuuuuuuuuuuuuuuuu.log',
maxsize: 2000,
maxFiles: 5,
tailable: true,
zippedArchive: true,
handleExceptions: true
};
now it's working but when I write in file without breaks, it's size grows to 5 KB but maxsize is 2000 bytes. After restarting my service it finally creates new file and archived old file.
This is a duplicate of #1174 鈥撀爌lease see the discussion around the approach https://github.com/winstonjs/winston/issues/1174#issuecomment-384512885
Most helpful comment
Isn't it
maxsize?