Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-733

Timerbased rollover writing to previous day's log file

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Blocker Blocker
    • None
    • 1.0.6
    • logback-core
    • None
    • linux

    Description

      We have boilerplate time-based rolling filer appender (see below). At midnight, rollover occurs correctly. But, sometime during the next few hours, a switch occurs and from then all logs are being written to the previous day's log file.

      I have seen the rollover at midnight and can confirm that at that point logging is correct. I have not observed the point at which the switch-back occurs but it is occurring each time.

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

      <!-- keep 30 days worth of history -->
      <maxHistory>30</maxHistory>

      <append>true</append>

      </rollingPolicy>

      <encoder>
      <pattern>%-5level [%thread] %d

      {HH:mm:ss.SSS}

      [%logger

      {0}

      ] - %msg%n</pattern>
      </encoder>
      </appender>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            jhakim jawaid hakim
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: