
Hello, I have a problem with TimeBasedRollingPolicy and that is older files are not deleted when I set the MaxHistory property in the xml,so any suggestions. Here is my XML file: <configuration> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>RollTimeTest.%d.log</FileNamePattern> <!-- keep #days worth of history --> <MaxHistory>2</MaxHistory> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%d{HH:mm:ss.SSS}[%thread] %-5level %logger{35} - %msg%n</Pattern> </layout> </appender> <root level="debug"> <appender-ref ref="FILE" /> </root> </configuration> Regards, Ayman Hammoudeh

Hello Ayman, The config file looks good. Does your application run continously or is it stopped and restarted by a cron job? Ayman Hammoudeh wrote:
Hello,
I have a problem with TimeBasedRollingPolicy and that is older files are not deleted when I set the MaxHistory property in the xml,so any suggestions.
Here is my XML file:
<configuration>
<appender name=/"FILE"/ class=/"ch.qos.logback.core.rolling.RollingFileAppender"/>
<rollingPolicy class=/"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"/>
<FileNamePattern>RollTimeTest.%d.log</FileNamePattern>
<!-- keep #days worth of history -->
<MaxHistory>2</MaxHistory>
</rollingPolicy>
<layout class=/"ch.qos.logback.classic.PatternLayout"/>
<Pattern>%d{HH:mm:ss.SSS}[%thread] %-5level %logger{35} - %_msg_%n</Pattern>
</layout>
</appender>
<root level=/"debug"/>
<appender-ref ref=/"FILE"/ />
</root>
</configuration>
Regards,
Ayman Hammoudeh
------------------------------------------------------------------------
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch
participants (2)
-
Ayman Hammoudeh
-
Ceki Gulcu