[ 
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:

{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:shell}
$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.


  was:
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:shell}
$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.



> 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:
> {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:shell}
> $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
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to