My application is shot-lived but even if I will force it to run longer, even if I will trigger midnight event delete does not occur only renaming :<br /><br />00:00:07,171 |-INFO in c.q.l.co.rolling.helper.RenameUtil - Renaming file [.\logs\log.log] to [.\logs\arch\log-2010-05-29.log]<br /><br />Renaming works also on application startup which is great for me.<br /><br />Thanks for answer.<br /><br />Tomasz Piec<br />
<blockquote style="font-size: 12px; padding-left: 1em; margin-left: 1em; margin-bottom: 0px; border-left: #ccc 2px solid;">You should add the following to the beginning of your config file to see <br />logback's attempts, if any, at deleting the files:<br /><br /><statusListener <br />class="ch.qos.logback.core.status.OnConsoleStatusListener" /><br /><br />Is your application long-lived or short-lived? Does it come up for a <br />short while and shut down?<br /><br />On 27/05/2010 5:07 PM, viral wrote:<br />> Hello.<br />> This was reported in previous versions on logback that MaxHistory does not<br />> delete old files.<br />> This bug is still present in 0.9.21.<br />> I tried numerous of configs and nothing.<br />><br />> example :<br />> <appender name="STD"<br />> class="ch.qos.logback.core.rolling.RollingFileAppender"><br />> <Append>true</Append><br />> <File>${log.dir}/log.log</File><br />> <layout class="ch.qos.logback.classic.PatternLayout"><br />> <pattern>%date{HH:mm:ss} %msg%n</pattern> <br />> </layout><br />> <rollingPolicy<br />> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><br />> <fileNamePattern>${log.arch.dir}/log%d{yyyy-MM-dd}.log</fileNamePattern><br />> <MaxHistory>5</MaxHistory> <br />> </rollingPolicy><br />> </appender><br />><br />> I have also tried :<br />> <TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"><br />> <MaxHistory>5</MaxHistory><br />> </TimeBasedFileNamingAndTriggeringPolicy><br />><br />> And still old files were not deleted. Can anyone advice ?<br />> I do smth wrong ?<br />> Being desperate I will delete all those files in my java code.<br />><br />> greets<br />><br />> Tomasz<br />><br /><br /><br />_______________________________________________<br />Logback-user mailing list<br />Logback-user@qos.ch<br />http://qos.ch/mailman/listinfo/logback-user<br /></blockquote>