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

RollingFileAppender with zip & %i doesn't rename active log file before being zipped

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: logback-core
    • Labels:
      None

      Description

      http://old.nabble.com/RollingFileAppender-with-compress----i-td31037552.html

      When compression is used for FixedWindowRollingPolicy, with %i in the file name pattern, the log files are not renamed with %i before compression.

      Resulting zip-files are created with appropriate rolled over names (%i). But all the log files inside those zip have a same name.

      Configuration (non relevant elements removed before posting)

      <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <File>logs/gateway.log</File>
      <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
      <maxIndex>20</maxIndex>
      <FileNamePattern>logs/gateway.log.%i.zip</FileNamePattern>
      </rollingPolicy>
      </appender>

      Results

      gateway.log.1.zip (with log file gateway.log.1)
      gateway.log.2.zip (with log file gateway.log.1)
      gateway.log.3.zip (with log file gateway.log.1)
      ...

      Should have been

      gateway.log.1.zip (with log file gateway.log.1)
      gateway.log.2.zip (with log file gateway.log.2)
      gateway.log.3.zip (with log file gateway.log.3)
      ....

        Attachments

          Activity

            People

            • Assignee:
              ceki Ceki Gülcü
              Reporter:
              deepak_vadgama Deepak Vadgama
            • Votes:
              6 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: