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

log4j2 can't compress rollover log file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.11.0
    • 2.13.0
    • Pattern Converters
    • None

    Description

      Hi, 

        When I used log4j2, I found in below case log4j2 can't compress my  rotate log file.

      <RollingRandomAccessFile name="mf-info" fileName="/var/log/oss_activity0_0.log"
      filePattern="/var/log/oss_activity0_%i.log.gz">

      ...

      <Policies>
          <TimeBasedRollingPolicy/>
          <SizeBasedTriggeringPolicy size="50 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="50" min="1" fileIndex="min">

      </DefaultRolloverStrategy>

      </RollingRandomAccessFile>

       

      I found when log file will rename to oss_activity0_1.log when oss_activity0_0.log reach 50MB size, but it will not be compressed to oss_activity0_1.log.gz. 

       

      Could you please help check this issue?

       

      Thanks

       

      Attachments

        1. logwrong.txt
          66 kB
          Frank Fan
        2. log_error1.log
          49 kB
          Frank Fan

        Activity

          People

            Unassigned Unassigned
            madangle Frank Fan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: