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.

Rotation with zip not save order of files

See original GitHub issue

Versions:

 "winston": "^3.2.1",
 "winston-daily-rotate-file": "^4.5.0"

Code:

new (transports.DailyRotateFile)({
                filename: "%DATE%.log",
                datePattern: 'YYYY-MM-DD',
                zippedArchive: true,
                maxSize: 1m,
                maxFiles: 50,
})

After reached the size limit on the same day, it continues to the next logs (2020-06-29.log.1) and zipping the old file (2020-06-29.log.gz). But, after starting the program again, It will create a new log (2020-06-29.log) again and not continue from the previous counting (2020-06-29.log.1). Also, after we reach the max size again, It will write to an existing file (2020-06-29.log.1), and it is not zipping the new log (2020-06-29.log) because we already have a zip file on this name.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mattberthercommented, Jul 16, 2020

Thank you, @yakirzana. I’m following https://github.com/rogerc/file-stream-rotator/pull/72 and will update this transport once that change has been merged. I’ll leave the ticket open until then.

1reaction
mattberthercommented, Jul 5, 2020

Please provide the smallest code snippet that reliably reproduces this problem. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compress old log files and move to new directory
But those files are not zipped properly. Will anyone please help me in figuring out the mistake my code? zip · archive.
Read more >
Picture Rotation - WinZip
After downloading your pictures from the camera, but before compressing them into your Zip file, WinZip will rotate the pictures as needed, as...
Read more >
Logrotate files with date in the file name - Stack Overflow
These files are not being rotated. I understand that I have to configure these in /etc/logrotate.d/tomcat6 file where rotation for catalina.out is configured....
Read more >
How to implement audit log rotation with compression based ...
For what I am doing, I don't need the files compress yet. So I didn't do the compression option. Will test the rotation...
Read more >
How to Configure Logrotate to Manage Logfiles (Step by Step)
Logrotate uses configuration files to set rules for the rotation's behavior, such as the maximum log files to keep, how often the rotation...
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