logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob L. Anawalt" <janaw...@geckosoftware.com>
Subject Re: Limiting the number of backups with time-triggered rollover
Date Mon, 07 Mar 2016 22:51:59 GMT

On 2016-03-07 2:05 PM, Bois, Bernard wrote:
> I'd like to know if it is possible to specify a maximum number of backups when a
> time-triggered rollover policy is used.

I don't believe there is a default configuration that works like that.

Perhaps you could make a policy object that does rolling like the 
FixedWindowRollingPolicy but uses the TriggeringPolicy from the 

> It appears both classes supporting time-based rollovers
> (DailyRollingFileAppender and rolling::RollingFileAppender) do not have such an
> option.

You need to look at the RollingPolicy implementation of 
rolling::RollingFileAppender to find that. The FixedWindowRollingPolicy has a 
max (and min) index used to rename a fixed number of backup files.

Jacob Anawalt
Gecko Software, Inc.

View raw message