You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2020/02/22 23:35:00 UTC

[jira] [Resolved] (LOG4J2-1726) RollingFile appender doesn't gzip and rolling log archives

     [ https://issues.apache.org/jira/browse/LOG4J2-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers resolved LOG4J2-1726.
---------------------------------
    Fix Version/s: 2.11.1
       Resolution: Fixed

This was fixed with LOG4J2-2680. Please verify and close.

> RollingFile appender doesn't gzip and rolling log archives
> ----------------------------------------------------------
>
>                 Key: LOG4J2-1726
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1726
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.7
>         Environment: Debian7.5 x64 with both openjdk7 and latest oraclejdk8.
>            Reporter: Gao Jie
>            Priority: Major
>             Fix For: 2.11.1
>
>
> When crossing diffenrent device, the newer version of log4j can't work with *RollingFile* appender.
> my config is:
> {code:xml}
>        <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>
> {code}
> the *fileName* and *filePattern* is on different devices:
> {code:none}
> $mount
> tmpfs on /opt/tmp type tmpfs (rw,relatime,size=20971520k)
> /dev/sda4 on /home type ext4
> {code}
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)