[logback-user] TimeBasedFileNamingAndTriggeringPolicy writes to many files after restart

Curtis Porter curtis.porter at gmail.com
Mon Jan 23 23:33:40 CET 2012

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.

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).

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?

Here is my configuration:

<configuration debug="false">
  <turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">

  <appender name="R"
      <Pattern>%d %p [%t] %X{user} %X{session} %F:%L - %m%n</Pattern>


  <logger name="org.apache.catalina.startup.Catalina" level="INFO" />

  <root level="warn">
    <appender-ref ref="R"/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20120123/94da76c5/attachment.html>

More information about the Logback-user mailing list