I am currently trying to set the maxSize in my winston daily rotate file, but the file always reaches a size of 121 kb and then later creates another file no matter what value is set for the maxSize here is the code I'm usin
const transport = new winston.transports.DailyRotateFile({
filename: '%DATE%_log_file.txt',
dirname: path.join(__dirname, '../../', 'logs'),
datePattern: 'YYYY-MM-DD-mm',
maxSize: '20m',
maxFiles: '2d'
});
The problem was having minutes in date format. Since my code runs for longer than a minute the transport updates the filename which in turn creates another log file since the time has changed.