[logback-user] Daily rolling appender

Sebastien Pennec sebastien at qos.ch
Fri Mar 30 10:49:44 CEST 2007

Hello Keith,

At this time, the TimeBasedRollingPolicy does not provide MinIndex and MaxIndex, and
thus does not delete any archived log files.

This is something that we have not discussed yet, so feel free to add a bug report 
for enhancement[1] if you need this feature.




Keith wrote:
> I am looking to use RollingFileAppender and TimeBasedRollingPolicy to 
> implement my solution of rotating logs and compressing them each day. 
> The configuration looks something like that:
> <configuration>
> <appender name="FILE" 
> class="ch.qos.logback.core.rolling.RollingFileAppender">
>  <File>logFile.log</File>
>  *<rollingPolicy 
> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>    <FileNamePattern>logFile.%d{yyyy-MM-dd}.log</FileNamePattern>
>  </rollingPolicy>*
>  <layout class="ch.qos.logback.classic.PatternLayout">
>    <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
>  </layout>
> </appender>
> <root>
>  <level value="debug" />
>  <appender-ref ref="FILE" />
> </root>
> </configuration>
> However, I would only like to keep seven compressed daily logs only. How 
> do I specify such an option in configuration file? Will I be able to use 
> MaxIndex and MinIndex?
> Thanks
> Keith
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user

Sébastien Pennec
sebastien at qos.ch

Logback: The reliable, generic, fast and flexible logging framework for Java.

More information about the Logback-user mailing list