-
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
With maxfiles and maxsize options, older timestamped log files are not removed #46
Comments
I might not be following you correctly but I have just created pull request #50 that I believe may provide the functionality that you're looking for. |
@kumar-b Can you please review the latest code and see if @markjbyrne81's PR (#50) fixes things? |
The reported issue occurs when both maxfiles and maxsize are set. Hopefully that is a valid scenario. The PR has fixed one part when only maxfiles is set. Now we have to combine both. I guess the issue title was misleading. I have changed it now. |
Faced with same problem. Will be awesome to implement combination of both. Thanks. |
Having exactly same problem on this end. Would be great to see this working since it is kind of a valid scenario. |
have anyone fixed this or found workaround? |
Is this still an issue with the new option introduced with #83? |
Some long-overdue refactoring of the transport has occured. A PR is available at #107. Also, a pre-release version has been published to npm. Please |
When maxfiles option is set, for current timestapmed logfiles, it removes the oldfiles. For ex: if maxfiles=2 and pattern=.dd then on third rollover it will have logfile.01.log and logfile.01.log.1, Here it is deleting logfile.01.log and creating logfile.01.log.2
But if based on time rotation happens, it creates new timestamped log files say logfile.02.log, then it has no history of what files are there from previous timestamp. And it's not removing them.
Here in code
https://github.com/winstonjs/winston-daily-rotate-file/blob/master/index.js#L588
it removes only files having current timestamp in the name.
How should we proceed from here? Should we keep a list of all existing log files and remove one when creating new?
The text was updated successfully, but these errors were encountered: