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

Capping log files does not work with large log file base

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.1.10
    • logback-core
    • 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. LOGBACK-1277.png
          536 kB
        2. SizeAndTimeBasedArchiveRemoverTest.java
          3 kB
        3. build.gradle
          0.9 kB
        4. logback.xml
          1 kB
        5. LOGBACK-1277_2.png
          154 kB

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: