lager
lager copied to clipboard
Keep filename extension in rotation
Insert file index before filename extension (if exist) and get
filename.0.log
filename.1.log
filename.2.log
instead of
filename.log.0
filename.log.1
filename.log.2
On my FreeBSD 12 system, the index comes at the end of the rotated name
(freebsd-var-log.txt). logrotate
appears to allow preserving the extension if you specify it.
@inikulshin is there a specific problem you're trying to solve?
Excuse me, I should have mentioned, that I'm working with Windows, which gives special attention to extensions.
E. g. I can define automatic opening of *.log
files with some text editor. But .0
, .1
, etc. - are unknown extensions and double clicking on such files (in explorer) opens dialog with programs list, where I should choose the desired text editor. At least once for each number.
OK, thanks for the explanation. The fastest way to get this implemented would be to submit a pull request with tests.
A workaround on Windows would be to set your text editor as the application for files ending in .0
, .1
, etc
A workaround on Windows would be to set your text editor as the application for files ending in
.0
,.1
, etc
Sure, that's why I wrote "At least once for each number" and not "Every time" :)