-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When does it start zipping logs? #108
Comments
It zips the logs after rotation. Please note that some long-overdue refactoring of the transport has occurred. A PR is available at #107. Also, a pre-release version has been published to npm. Please npm install [email protected] if you see any strangeness with the 1.x transport and zipping. Please re-open this issue if you have further questions. |
It zips after one day? I have many .log files from months ago. Does the application have to run continually for it to zip them up daily? Maybe it should become a feature where, upon starting, it can detect old log files and zip them up. |
The application will zip the log after it is rotated, assuming |
Is it possible to make it so that it does zip up log files that were generated by previous instances of the same app? |
The transport will not be updated to zip up log files that the currently running process did not create. Perhaps this is something that your app can do prior to instantiating the winston logger. |
Would it be possible to expose a method for zipping logs? |
No, but your app code can zip logs using this code: var zlib = require('zlib');
var oldFile = someMethodToRetrieveYourFile();
var gzip = zlib.createGzip();
var inp = fs.createReadStream(oldFile);
var out = fs.createWriteStream(oldFile + '.gz');
inp.pipe(gzip).pipe(out).on('finish', function () {
fs.unlinkSync(oldFile);
}); |
No description provided.
The text was updated successfully, but these errors were encountered: