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

RollingFileAppender + TimeBasedRollingPolicy is not deleting the files

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 0.9.21
    • logback-core
    • Solaris 10 ( sparc ) - java version "1.6.0_20"
      Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
      Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)

    Description

      Logack is not deleting the files when I set maxHistory

      This is how my xml file looks like, while I was running my test to check whether the log files were deleted. every minute and keeping only 2 files , but files just keep being created but not deleted as it was defined.

      <appender name="FOLD_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <File>/app/fold/logs/out.log</File>

      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- rollover daily -->
      <fileNamePattern>/app/fold/logs/out_%d

      {yyyy-MM-dd_HH-mm}

      .txt</fileNamePattern>

      <maxHistory>2</maxHistory>
      </rollingPolicy>

      <encoder>
      <pattern>%d

      {yyyy-MMM-dd HH:mm:ss.SSS}

      [%thread] %-5level %logger

      {36}

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

      </appender>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            gabuenader Gabriel Buenader
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: