Closed tresf closed 11 months ago
I'm not sure this quite preserves logs how you indicated it should?
We don't convert any of the old format to the new and the rollover increments the number so .log.5
will be the oldest file, but if .5.log
hasn't been rolled into yet with the this code, that oldest file will still be around even though newer, lower numbered old logs will have been removed.
If anything, we should get a count of both the old format and the new format then delete the old format files, highest number first, down to the rollover count.
that oldest file will still be around even though newer, lower numbered old logs will have been removed.
Yes, but it's a self-healing wound, once 5.log is created, log.5 will be deleted the next time it opens, no?
If anything, we should get a count of both the old format and the new format then delete the old format files, highest number first, down to the rollover count.
I don't want to purge good logs unless they're outdated.
Oh, I see what you're saying... It deleted oldest files last instead of first.... Hmm ok, I'll have to rework this then...
Perform cleanup of old log file rotations:
debug.log.1
debug.log.2
debug.log.3
debug.log.4
debug.log.5
In favor of new format introduced in #1160:
debug.1.log
debug.2.log
debug.3.log
debug.4.log
debug.5.log
... but not without ensuring a replacement adjacent log exists first, to avoid any debugging data loss.
Closes #1196