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

Error in FileNamePattern::toRegex for index (Integer)

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • logback-core
    • None

    Description

      Deletion of old archived logs on rolling failes for index > 99.

      We have a process which logs much, which results in more than 99 log files per day (config below), e.g.
      snowball_POLL_MSG_SRV_xdebug-old-2011-09-13.110.log.zip.

      On rolling event, only the first 99 were deleted, due to bug in
      FileNamePattern::toRegex for index (Integer):
      regEx: \d{1,2)
      which means digits with max length of 2.

      We need at least 3 digits:
      regEx: \d{1,3)
      better 4?

      Workarounds like increasing file size, or hourly-rollover to hold index lower than 100 are not very wellcomed.

      Thanks in advance,
      Dieter Mueller.

      config:
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <!-- rollover daily -->
      <fileNamePattern>${log.vm.file.prefix}_xdebug-old-%d

      {yyyy-MM-dd}

      .%i.log.zip</fileNamePattern>
      <maxHistory>1</maxHistory>
      <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
      <maxFileSize>20MB</maxFileSize>
      </timeBasedFileNamingAndTriggeringPolicy>
      </rollingPolicy>

      Attachments

        Activity

          People

            logback-dev Logback dev list
            muellerd Dieter Mueller
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: