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

RollingFile appender doesn't gzip and rolling log archives

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.11.1
    • Component/s: Appenders
    • Labels:
      None
    • Environment:

      Debian7.5 x64 with both openjdk7 and latest oraclejdk8.

      Description

      When crossing diffenrent device, the newer version of log4j can't work with RollingFile appender.

      my config is:

             <RollingFile name="RollingFile" fileName="/opt/tmp/chat_server_all.log"    bufferedIO="true" bufferSize="50000"
                       filePattern="logs/$${date:yyyy-MM}/chat_server_info-%d{yyyy-MM-dd}-%i.log.gz">
                  <PatternLayout pattern="%d{yyyy.MM.dd 'at' HH:mm:ss z} %-5level %class{36} %L %M - %msg%xEx%n"/>
                  <Policies>
                      <SizeBasedTriggeringPolicy size="500 MB" />
                      <TimeBasedTriggeringPolicy interval="6" modulate="true"/>
                  </Policies>
                  <DefaultRolloverStrategy max="50"/>
              </RollingFile>
      
      

      the fileName and filePattern is on different devices:

      $mount
      tmpfs on /opt/tmp type tmpfs (rw,relatime,size=20971520k)
      /dev/sda4 on /home type ext4
      

      however there is an Exception java.nio.file.AtomicMoveNotSupportedException. THen, only one archive log file under logs/2016-12/:
      chat_server_info-2016-12-08-1.log
      and never compressed. RollingRandomAccessFile has the same problem.

      However,log4j 2.1 works well.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                userid Gao Jie
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: