My Kro commented on Bug LOGBACK-747

I have the same problem.

slf4j and logback 1.0.0.13.

logback.xml:

<configuration>
<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>logs/event.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>logs/event-%d

{yyyyMMdd}

-%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches the threshold -->
<maxFileSize>20KB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>

<!-- and clean up old files -->
<maxHistory>3</maxHistory>
<cleanHistoryOnStart>true</cleanHistoryOnStart>

</rollingPolicy>
<encoder>
<pattern>%msg%n</pattern>
</encoder>
</appender>

<root level="DEBUG">
<appender-ref ref="ROLLING" />
</root>

</configuration>

At no point do the old files get deleted:

Directory of <app>\logs

12/08/2013 03:30 PM <DIR> .
12/08/2013 03:30 PM <DIR> ..
12/08/2013 02:46 PM 21,172 event-20130812-0.log
12/08/2013 02:55 PM 20,977 event-20130812-1.log
12/08/2013 02:55 PM 20,586 event-20130812-2.log
12/08/2013 02:55 PM 20,626 event-20130812-3.log
12/08/2013 02:56 PM 20,598 event-20130812-4.log
12/08/2013 02:56 PM 21,503 event-20130812-5.log
12/08/2013 02:59 PM 20,516 event-20130812-6.log
12/08/2013 03:00 PM 20,634 event-20130812-7.log
12/08/2013 03:29 PM 21,532 event-20130812-8.log
12/08/2013 03:30 PM 20,930 event-20130812-9.log
12/08/2013 03:30 PM 12,804 event.log
11 File(s) 221,878 bytes
2 Dir(s) 491,675,648 bytes free

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira