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

Log will still be appended to the rolled-over file besides the current active file with SizeBasedTriggeringPolicy and FixedWindowRollingPolicy

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Major Major
    • None
    • 1.1.2
    • logback-core
    • None
    • Red Hat Enterprise Linux Server release 6.3, java version "1.6.0_24"

    Description

      The logback.xml configuration snippet:
      <property name="RSF_USER_HOME" value="/opt/logs/rsf"/>

      <appender name="rsfStatistic" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <File>${RSF_USER_HOME}/Server1/ssds/rsf_statistic.log</File>

      <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <FileNamePattern>${RSF_USER_HOME}/Server1/ssds/rsf_statistic.log.%i.bak</FileNamePattern>
      <MinIndex>1</MinIndex>
      <MaxIndex>5</MaxIndex>
      </rollingPolicy>

      <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
      <MaxFileSize>100MB</MaxFileSize>
      </triggeringPolicy>

      <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%msg%n</Pattern>
      </layout>
      </appender>

      <logger name="rsf.statistic" level="INFO" additivity="false">
      <appender-ref ref="rsfStatistic"/>
      </logger>

      The log file list:

      You'll find that some log will still be appended to the rsf_statistic.log.1.bak which has already rolled over, simultaneously some different log will be appended to the current active file rsf_statistic.log. This bug is hard to reproduce deliberately, but occur in our several application system. It'll recover after restarting the application server. (Only one JVM is writing the file.)

      Attachments

        Activity

          People

            logback-dev Logback dev list
            jag522 Jag
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: