You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have following usage of winston with file transport:
this._log = new(winston.Logger)({
transports: [
new(winston.transports.File)({
name: 'file_transp',
level: 'debug',
showLevel: false,
filename: 'test.log',
dirname: './',
maxsize: 1024,
maxFiles: 3,
}
})
]
});
When writing to it and exceeding the maxsize, new files are created just as expected. However, the number of files saved is not limited to 3 (I got to 28).
I have following usage of winston with file transport:
this._log = new(winston.Logger)({
transports: [
new(winston.transports.File)({
name: 'file_transp',
level: 'debug',
showLevel: false,
filename: 'test.log',
dirname: './',
maxsize: 1024,
maxFiles: 3,
}
})
]
});
When writing to it and exceeding the maxsize, new files are created just as expected. However, the number of files saved is not limited to 3 (I got to 28).
looking at transports/file.js, func _checkMaxFilesIncrementing, line 557.
557: target = path.join(this.dirname, basename + (oldest === 0 ? oldest : '') + ext);
558: fs.unlink(target, callback);
It seems to me that it should be oldest !== 0 (verified to work with the parameters I've written above).
The text was updated successfully, but these errors were encountered: