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

SizeAndTimeBasedRollingPolicy can't remove old logs files

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 1.1.7, 1.1.8, 1.2.0
    • 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

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

            Dates

              Created:
              Updated: