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

SizeAndTimeBasedRollingPolicy can't remove old logs files

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.1.7, 1.1.8, 1.2.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      I configured logback.xml like below, but it can't remove old log files before 3 days  or total size cap exceed 10MB.

      <appender name="test" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <file>/var/log/test.log</file>
      <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
      <fileNamePattern>/var/log/test.%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
      <maxFileSize>1MB</maxFileSize>
      <maxHistory>3</maxHistory>
      <totalSizeCap>10MB</totalSizeCap>
      </rollingPolicy>
      <encoder>
      <Pattern>${ENCODER_PATTERN}</Pattern>
      <charset>UTF-8</charset>
      </encoder>
      </appender>

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              logback-dev Logback dev list
              Reporter:
              vincent vincentliu
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: