winston: Winston Transport File - zippedArchive option doesn't work correctly
If you use the following transport file:
new (winston.transports.File)({
level: 'silly',
filename: './test.log',
maxsize: 500000,
maxFiles: 4,
format: format.combine(
format.splat(),
format.label({ label: 'test' }),
format.timestamp(),
format.prettyPrint(),
format.printf( log => {
return '[ ' + log.timestamp + ' ][ ' + log.level + ' ][ '+ log.label + ' ] ' + log.message;
})
), tailable: true,
zippedArchive: true,
exitOnError: false
}) );
The resulting “test.log” is zipped.
This is wrong since the documentation tells that:
zippedArchive: If true, all log files but the current one will be zipped.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 18
- Comments: 33 (9 by maintainers)
Still happening on 3.3.3 😔
@masoudltf: you are right, the latest winston (3.1.0) doesn’t zip any file but only adds the .gz extension. Infact, it seems there is no method which inflates the logs, only the Zlib instance
+1 zippedArchive option on winston.transports.File is broken - resulting files have .gz suffix, but are corrupted.
winston version 3.2.1
The problem persists in version 3.8.1.
i have same issue, only “.gz” appends to the filename and not correctly gzipped.
Done — thank you so much for being willing to take this on!!
Hi @DABH , I would like to give it a try. Please assign it to me.
I have the same issue with 3.0.0.
This results in the latest file being gzipped. In 2.4.2, all but the latest file were zipped.