Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2680

Not compressing after rolling a file using copy and truncation method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.6.2, 2.7, 2.8, 2.8.1, 2.8.2, 2.9.0, 2.9.1, 2.10.0, 2.11.0, 2.11.1, 2.11.2, 2.12.0, 2.12.1
    • 2.12.1
    • Core
    • None
    • Windows 2016 Server

    • Patch, Important

    Description

      When log file has reached rolling size, method "execute" on "org.apache.logging.log4j.core.appender.rolling.action.FileRenameAction" class run as follows:

      1. Move the log file to a new one using a new name;
      2. If move fails, then it renames the log file;
      3. If rename fails, then it copies the original file and then:
          3.1 Deletes original file;
          3.2 if delete fails, then it truncates the original file contents.

      Steps 2 and 3 are executed usually when original file is locked; after any successful step, the returning value should be "true", however after successfully executing step 3.2 it remains "false", avoiding the compression algorithm to be executed.

      Attachments

        1. fix.png
          67 kB
          Guillermo Xavier Hurtado Garcia

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hurtadogx Guillermo Xavier Hurtado Garcia
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Time Spent - 20m Remaining Estimate - 40m
                  40m
                  Logged:
                  Time Spent - 20m Remaining Estimate - 40m
                  20m