Uploaded image for project: 'JBoss Log Manager'
  1. JBoss Log Manager
  2. LOGMGR-255

PeriodicRotatingFileHandler doesn't rotate log content when using Compression

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 2.1.13.Final, 3.0.0.Alpha1
    • 2.1.11.Final
    • None
    • None

      When configuring a PeriodicRotatingFileHandler where the suffix ends with .zip or .gz, as such:

                  <periodic-rotating-file-handler name="FILE" autoflush="true">
                      <formatter>
                          <named-formatter name="PATTERN"/>
                      </formatter>
                      <file relative-to="jboss.server.log.dir" path="server.log"/>
                      <suffix value=".yyyy-MM-dd-HH.gz"/>
                      <append value="true"/>
                  </periodic-rotating-file-handler>
      

      This is supposed to compressed the rotated logs to save space. See https://issues.jboss.org/browse/LOGMGR-30

      What I'm seeing is that the rotation log file is successfully created and compressed at the periodic interval, however the log file content is not removed.

      This means that the log file itself continues to grow instead of rotating log content, and each rotation log contains the content from all the previous, so their size gets larger and larger:

      -rw-r--r--. 1 jboss jboss 1779799 Jun 18 21:03 server.log
      -rw-r--r--. 1 jboss jboss   21831 Jun 18 19:00 server.log.2019-06-18-18.gz
      -rw-r--r--. 1 jboss jboss   55168 Jun 18 20:00 server.log.2019-06-18-19.gz
      -rw-r--r--. 1 jboss jboss   88021 Jun 18 21:00 server.log.2019-06-18-20.gz
      

      NOTE: This issue would exist for SizeRotatingFileHandler and PeriodicSizeRotatingFileHandler

              jperkins-rhn James Perkins
              cira-alain Alain Baxter (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: