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

RollingFileAppender + TimeBasedRollingPolicy + MaxHistory ,Can't clear historical document

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.9.28
    • logback-core
    • None
    • windows/tomcat/
      java
      webapp

    Description

      <configuration>
      <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
      <encoder>
      <pattern>%date [%thread] %-5level %logger

      {80} - %msg%n</pattern>
      </encoder>
      </appender>
      <appender name="file—debug"
      class="ch.qos.logback.core.rolling.RollingFileAppender">
      <filter class="ch.qos.logback.classic.filter.LevelFilter">
      <level>DEBUG</level>
      <onMatch>ACCEPT</onMatch>
      <onMismatch>DENY </onMismatch>
      </filter>
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <FileNamePattern>F:/other/logs/MarginCore/Test-%d{yyyy-MM-dd}.log</FileNamePattern>
      <MaxHistory>1</MaxHistory>
      </rollingPolicy>
      <encoder>
      <pattern>%date [%thread] %-5level %logger{80}

      - %msg%n</pattern>
      </encoder>
      </appender>

      <root level="DEBUG">
      <appender-ref ref="stdout" />
      <appender-ref ref="file—debug" />
      </root>
      </configuration>

      This configuration, history log file is not deleted.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            ice ice
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: