OK, so the problem here is that logrotate
uses these filename extensions to keep track of its rotations. So if you have x.log
, it inherently needs a predictable, sequential extension to keep track of what is what; i.e. x.log.1
is the first rotation, x.log.2
is the second, etc.
By renaming the file like that, you're moving the extension to the middle of the file and subsequently leaving each file with the same extension: .log
. So as far as logrotate is concerned, it will think those are all unrelated files, not rotations of a previous log.
E.g., if you rename Test.log.1
to Test_1.log
, and leave that file in the same folder, logrotate
won't know that it's a rotation of Test.log
and create a new Test.log.1
upon next rotation. And so on, and so on.
So the short answer is no, there is no logrotate
directive that will rename a file like you want. You will have to create this functionality yourself using a postrotate
script, and you will also have to (at some point) move these files out of the var/log/
directory once they're renamed, using either said postrotate
script or the olddir
directive.
The dateext
directive might also be useful, as in my opinion date extensions are typically more user-friendly than numerical ones.