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

maxHistory doesnot normally work in SizeAndTimeBasedFNATP

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.7
    • None
    • None
    • None

    Description

      <appender name="sizeAndTimeBased" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>./logs/ExtensibleServices.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
          <fileNamePattern>./logs/ExtensibleServices.%d{yyyyMMdd}.%i.log</fileNamePattern>
          <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
            <maxFileSize>1MB</maxFileSize>
            <maxHistory>2</maxHistory>  <!--this is a bug-->
          </timeBasedFileNamingAndTriggeringPolicy>
        </rollingPolicy>
        <encoder>
          <pattern>%d{yyyy-MM-dd}T%d{HH:mm:ss.SSS} %msg%n</pattern>
        </encoder>
      </appender>
      

      The figure below describes the test result.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            billy Billy Wang
            Votes:
            13 Vote for this issue
            Watchers:
            23 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: