emabee / flexi_logger

A flexible logger for rust programs that can write to stderr, stdout, and/or to log files
Apache License 2.0
307 stars 50 forks source link

Is there a way to control how rotated log files are renamed? #172

Open Elcoid opened 3 days ago

Elcoid commented 3 days ago

Hello!

I see that rotating with Numbers yields files that look like this:

my_daemon_rCURRENT.log
my_daemon_r00000.log
my_daemon_r00001.log
...

and rotating with NumbersDirect yields files that look like this:

my_daemon_r00000.log
my_daemon_r00001.log
my_daemon_r00002.log
...

However, I would like to be able to have the following (as is usual on *nix from what I could see, and this is what file_rotate does by default), is it possible?

my_daemon.log
my_daemon.log.1
my_daemon.log.2
...
emabee commented 1 day ago

That's not implemented so far - thanks for the proposal!

emabee commented 4 hours ago

May I ask about the advantage of this approach, as it comes with the disadvantage that the rotated files cannot be easily recognized as log files?