I have created a Winston logger:
_logger.add(logger.transports.File, {
filename: conf_fileName,
timestamp:'true',
maxsize: 1024,
maxFiles: 2
});
But after couple of hours I have lot of files in size of ~2kb. Is there something wrong with the logger definition?
The maxsize
is in bytes - so you are limiting the logfiles to 1KB (which may be reported by your OS as 2KB).
If you want 1MB, try maxsize: 1048576
There is an issue where maxFiles
and maxsize
are both set where it does not honor your maxFiles
setting.