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

Davide Steduto updated LOG4J2-1536:
-----------------------------------
    Description: 
{{RollingRandomAccessFileAppender}} and {{RollingFileAppender}} currently 
support the configuration to compress automatically files _every time_ it rolls 
and to delete compressed file after Y days under provided conditions, but it 
compresses at every rolling while we should have the possibility to keep the 
last X rolled files uncompressed before it starts the compression.

Usually when we investigate, we do it for few days back, therefore those files 
should remain uncompressed without the need to decompress the file that just 
rolled (for instance: midnight is just passed).

I would add a new attribute named *max="5"* (keep last 5 logs uncompressed). 
You choose the name. Default value = 0 (it always compresses).

{code:xml}
<RollingRandomAccessFile name="file" fileName="${baseDir}/app-trace.log"
               filePattern="${baseDir}/app-trace-%d{yyyy-MM-dd}.log.gz" max="5"
               immediateFlush="false" append="true">
...
</RollingRandomAccessFile>
{code}

Thank you,
Davide

  was:
{{RollingRandomAccessFile}} and {{RollingFileAppender}} currently support the 
configuration to compress automatically files _every time_ it rolls and to 
delete compressed file after Y days under provided conditions, but it 
compresses at every rolling while we should have the possibility to keep the 
last X rolled files uncompressed before it starts the compression.

Usually when we investigate, we do it for few days back, therefore those files 
should remain uncompressed without the need to decompress the file that just 
rolled (for instance: midnight is just passed).

I would add a new attribute named *max="5"* (keep last 5 logs uncompressed). 
You choose the name. Default value = 0 (it always compresses).

{code:xml}
<RollingRandomAccessFile name="file" fileName="${baseDir}/app-trace.log"
               filePattern="${baseDir}/app-trace-%d{yyyy-MM-dd}.log.gz" max="5"
               immediateFlush="false" append="true">
...
</RollingRandomAccessFile>
{code}

Thank you,
Davide


> Compressing aged Rolled Files, keep last X file uncompressed
> ------------------------------------------------------------
>
>                 Key: LOG4J2-1536
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1536
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Appenders
>            Reporter: Davide Steduto
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> {{RollingRandomAccessFileAppender}} and {{RollingFileAppender}} currently 
> support the configuration to compress automatically files _every time_ it 
> rolls and to delete compressed file after Y days under provided conditions, 
> but it compresses at every rolling while we should have the possibility to 
> keep the last X rolled files uncompressed before it starts the compression.
> Usually when we investigate, we do it for few days back, therefore those 
> files should remain uncompressed without the need to decompress the file that 
> just rolled (for instance: midnight is just passed).
> I would add a new attribute named *max="5"* (keep last 5 logs uncompressed). 
> You choose the name. Default value = 0 (it always compresses).
> {code:xml}
> <RollingRandomAccessFile name="file" fileName="${baseDir}/app-trace.log"
>                filePattern="${baseDir}/app-trace-%d{yyyy-MM-dd}.log.gz" 
> max="5"
>                immediateFlush="false" append="true">
> ...
> </RollingRandomAccessFile>
> {code}
> Thank you,
> Davide



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to