[logback-user] MaxHistory does not delete old files

viral viral at tlen.pl
Thu May 27 17:07:59 CEST 2010


Hello.
This was reported in previous versions on logback that MaxHistory does not
delete old files.
This bug is still present in 0.9.21.
I tried numerous of configs and nothing.

example :
  <appender name="STD"
  class="ch.qos.logback.core.rolling.RollingFileAppender">
    <Append>true</Append>
    <File>${log.dir}/log.log</File>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <pattern>%date{HH:mm:ss} %msg%n</pattern>	  
    </layout>
    <rollingPolicy
    class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>${log.arch.dir}/log%d{yyyy-MM-dd}.log</fileNamePattern>
	  <MaxHistory>5</MaxHistory>	  
    </rollingPolicy>
  </appender>

I have also tried :
 <TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  <MaxHistory>5</MaxHistory>
 </TimeBasedFileNamingAndTriggeringPolicy>

And still old files were not deleted. Can anyone advice ?
I do smth wrong ?
Being desperate I will delete all those files in my java code.

greets

Tomasz



More information about the Logback-user mailing list