logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dale King" <dalewk...@gmail.com>
Subject Re: Does TimeBasedRollingPolicy work with MaxBackupIndex?
Date Sat, 11 Oct 2008 15:30:35 GMT
I thought we already went over this. No, you cannot use both of them
together. Think about how this would work. When log4cxx rolls over, how it
would it figure out files that it should delete. Anything you come up with
will be a hack and not reliable. For SizeBasedRollingPolicy it has an easy
way to figure out which files to delete. There is a file name pattern where
it deletes the one with the max backup index in the filename and renames the
others one number higher. There is no easy way to do this with time based
rolling.


On Fri, Oct 10, 2008 at 6:01 AM, Jathy <xuehai.fan@yahoo.com> wrote:

>
> I used TimeBasedRollingPolicy of RollingFileAppender to rollover log file
> every minute. And at the same time I'd like to use MaxBackupIndex to set
> the
> max number of backup files. But MaxBackupIndex does not work.
> TimeBasedRollingPolicy cannot work with MaxBackupIndex or my configuration
> file has some wrong? I attached my configuration:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <log4j:configuration xmlns:log4j='http://logging.apache.org/'
> debug="true">
>  <appender name="ROLLING"
> class="org.apache.log4j.rolling.RollingFileAppender">
>            <rollingPolicy
> class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
>
>            </rollingPolicy>
>
>    <layout class="org.apache.log4j.PatternLayout">
>
>    </layout>
>
>  </appender>
>  <root>
>    <level value="INFO"/>
>    <appender-ref ref="ROLLING"/>
>  </root>
> </log4j:configuration>
> --
> View this message in context:
> http://www.nabble.com/Does-TimeBasedRollingPolicy-work-with-MaxBackupIndex--tp19915414p19915414.html
> Sent from the Log4cxx - Users mailing list archive at Nabble.com.
>
>


-- 
Dale King

Mime
View raw message