Change FixedWindowRollingPolicy rolling behaviour

Hi can I change FixedWindowRollingPolicy to rollover as follows: foo.log active log file foo1.log first rollover foo2.log second rollover foo3.log third rollover Current behaviour is second rollover. foo1.log is renamed as foo2.log. foo.log is renamed as foo1.log -- View this message in context: http://logback.10977.n7.nabble.com/Change-FixedWindowRollingPolicy-rolling-b... Sent from the Users mailing list archive at Nabble.com.

Hi DK, It's not clear what you are asking for. Currently the files are renamed in reverse order so that there is no name clash. What other strategy are you suggesting? David
On 27 Apr 2016, at 15:05, DK <desmond.kirrane@gmail.com> wrote:
Hi can I change FixedWindowRollingPolicy to rollover as follows:
foo.log active log file foo1.log first rollover foo2.log second rollover foo3.log third rollover
Current behaviour is second rollover. foo1.log is renamed as foo2.log. foo.log is renamed as foo1.log
-- View this message in context: http://logback.10977.n7.nabble.com/Change-FixedWindowRollingPolicy-rolling-b... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

Ok, maybe I'm missing something... but instead of reverse order could FixedWindowRollingPolicy maintain a 'currentIndex' - It begins with currentIndex = 0 - The active file is always foo.log - On each rollover foo.log is renamed: foo{currentIndex+1}.log When number of rollover > maxIndex just start deleting the earlier rollovers foo1.log, foo2.log etc... -- View this message in context: http://logback.10977.n7.nabble.com/Change-FixedWindowRollingPolicy-rolling-b... Sent from the Users mailing list archive at Nabble.com.

That seems reasonable, and it avoids the "too many renames" problem that the current strategy has. It would need additional logic to determine what index to start with at app startup time. Of course if you submit an initial implementation that would move things along. :-) David
On 13 May 2016, at 08:44, DK <desmond.kirrane@gmail.com> wrote:
Ok, maybe I'm missing something... but instead of reverse order could FixedWindowRollingPolicy maintain a 'currentIndex'
- It begins with currentIndex = 0 - The active file is always foo.log - On each rollover foo.log is renamed: foo{currentIndex+1}.log
When number of rollover > maxIndex just start deleting the earlier rollovers foo1.log, foo2.log etc...
-- View this message in context: http://logback.10977.n7.nabble.com/Change-FixedWindowRollingPolicy-rolling-b... Sent from the Users mailing list archive at Nabble.com. _______________________________________________ logback-user mailing list logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
participants (2)
-
David Roussel
-
DK