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 "Davide Steduto (JIRA)" <ji...@apache.org> on 2016/08/19 22:12:20 UTC

[jira] [Created] (LOG4J2-1536) Compressing aged Rolled Files, keep last X file uncompressed

Davide Steduto created LOG4J2-1536:
--------------------------------------

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


{{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



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