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

Capping log files does not work with large log file base

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1.10
    • Fix Version/s: None
    • Component/s: logback-core
    • Labels:
      None

      Description

      I am using SizeAndTimeBasedRollingPolicy and I was wondering why logback ignores my totalSizeCap settings. totalSizeCap was set to 5GB and the total size of my log files was about 8GB. I started my application (a Spring Boot Application) and no files were removed. When testing with smaller settings (256MB totalSizeCap) files were removed as expected.

      So I debugged TimeBasedArchiveRemover.capTotalSize and found out that totalSize got negative. Making totalSize (and totalRemoved) long instead of int should fix the problem.

        Attachments

        1. build.gradle
          0.9 kB
        2. logback.xml
          1 kB
        3. LOGBACK-1277_2.png
          LOGBACK-1277_2.png
          154 kB
        4. LOGBACK-1277.png
          LOGBACK-1277.png
          536 kB
        5. SizeAndTimeBasedArchiveRemoverTest.java
          3 kB

          Issue Links

            Activity

              People

              Assignee:
              logback-dev Logback dev list
              Reporter:
              caro Carsten Röttgers
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: