question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Winston Transport File - zippedArchive option doesn't work correctly

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:17
  • Comments:23 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
mattvasccommented, Nov 12, 2020

@DABH I have the same issue too, I also upgraded my Winston version to latest version (3.2.1) but still no success. when the zippedArchive is true , the logger only rename the extension of file so the zip file is corrupted.

Still happening on 3.3.3 😔

4reactions
KingRialcommented, Dec 10, 2018

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

winston - npm
A multi-transport async logging library for Node.js. ... Awaiting logs to be written in winston; Working with multiple Loggers in winston.
Read more >
Winston not displaying error details - node.js - Stack Overflow
It is a module that I am using to log some information to a file and some to a mysql database. require('dotenv').config(); const ......
Read more >
A multi-transport async logging library for Node.js
Logger.prototype.add (transport, options, created); function winston. ... this might not be exactly correct, // but probably close-enough for purposes of ...
Read more >
How to use Winston Daily Rotate File Logger in NodeJs
Winston daily rotate file ensure that we do not have all log being written ... And also daily rotate file function with option...
Read more >
Complete Winston Logger Guide With Hands-on Examples
The open-source Winston logger helps take a load off our shoulders ... 30 transports options, which include logging out into a single file, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found