While doing some testing I've encountered a situation where we generate a large number of log files. They seem to be rotating as expected, except for directly after a restart of the application. When that happens, logback writes a few messages to each file, starting at index 101 until it reaches the current file, at which point it resumes working normally.<br>
<br>For example, the logs should rotate each month, and grow up to 10MB before rotating. As each rotates its log index will increase (2012-01.1.log, 2012-01.2.log, ..., 2012-01.891.log). logback is writing the first few messages to 2012-01.101.log and then walks up each log after that, writing a few log messages before moving on (presumably "realizing" that each log is at its size threshold).<br>
<br>I'm puzzled that it starts at 2012-01.101.log (2012-01.1.log would make more sense). It's even more puzzling that it writes anything to the lower logs in the first place. Any ideas why this is happening?<br><br>
Here is my configuration:<br><br><configuration debug="false"><br> <turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter"><br> <Marker>ALWAYS</Marker><br> <OnMatch>ACCEPT</OnMatch><br>
</turboFilter> <br><br> <appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender"><br> <prudent>true</prudent><br> <encoder><br> <Pattern>%d %p [%t] %X{user} %X{session} %F:%L - %m%n</Pattern><br>
</encoder><br> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"><br> <FileNamePattern>${catalina.home}/logs/tomcat.%d{yyyy-MM}.%i.log</FileNamePattern><br>
<TimeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"><br> <maxFileSize>10MB</maxFileSize><br> </TimeBasedFileNamingAndTriggeringPolicy><br>
<maxHistory>2</maxHistory><br> </rollingPolicy><br> </appender><br><br><br> <logger name="org.apache.catalina.startup.Catalina" level="INFO" /><br><br> <root level="warn"><br>
<appender-ref ref="R"/><br> </root><br></configuration><br>