You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gao Jie (JIRA)" <ji...@apache.org> on 2016/12/08 03:21:58 UTC
[jira] [Updated] (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 ]
Gao Jie updated LOG4J2-1726:
----------------------------
Description:
When crossing diffenrent device, the newer version of log4j can't work with @RollingFile@ appender.
my config is:
bc. <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:
bc. 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/:
bc. chat_server_info-2016-12-08-1.log
and never compressed. @RollingRandomAccessFile@ has the same problem.
However log4j @2.1@ works well.
was:
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:
tmpfs on /opt/tmp type tmpfs (rw,relatime,size=20971520k)
/dev/sda4 on /home type ext4
however there is an Exception java.nio.file.Atomic Move NotSupportedException. 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.
> 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
>
> When crossing diffenrent device, the newer version of log4j can't work with @RollingFile@ appender.
> my config is:
> bc. <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:
> bc. 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/:
> bc. 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
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org