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

SizeAndTimeBasedRollingPolicy not removing old files when aux is used

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.2.11
    • None
    • None
    • Spring boot 2.7 with logback 2.11

    Description

      Using this appender, the files are not deleted. It works without the aux date, but in my case the aux date is very important.

      <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
          <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
              <fileNamePattern>c:/temp/logs/spring-FILE-boot.%d{yyyy-MM-dd} - %-3i - %d{HH.mm.ss, aux}.log</fileNamePattern>
              <maxFileSize>500KB</maxFileSize>    
              <maxHistory>5</maxHistory>
              <totalSizeCap>1MB</totalSizeCap>
              <cleanHistoryOnStart>true</cleanHistoryOnStart>
          </rollingPolicy>
          <encoder>
              <pattern>%-20(%d{dd.MM.yyyy HH:mm:ss.SSS} [%-20thread]) %-5level %msg [%logger:%line]%n</pattern>
          </encoder>
      </appender>    

      Attachments

        Activity

          People

            logback-dev Logback dev list
            bwa Bjørn-Willy Arntzen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: