[
https://issues.apache.org/jira/browse/LOG4J2-524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14635846#comment-14635846
]
ASF GitHub Bot commented on LOG4J2-524:
---------------------------------------
GitHub user nbartels opened a pull request:
https://github.com/apache/logging-log4j2/pull/12
LOG4J2-524: autodelete older files while rollover
This pull request adds the possibility to configure a `maxAge` in days. The
original work is done by @arun0009.
If no `maxAge` is given, the `DefaultRolloverStrategy` works as before.
ATM I have some problems writing a test, because the timespan is at least
one day :smile: Hopefully I get some input to provide one.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nbartels/logging-log4j2
LOG4J2-524-autodelete-old-files
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/logging-log4j2/pull/12.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12
----
commit 903357457d1a2116e7568ebd0cbc742a9edf1d67
Author: Norbert Bartels <[email protected]>
Date: 2015-07-21T21:24:36Z
LOG4J2-524: autodelete older files while rollover (based on work of
@arun0009)
----
> Feature request: auto-delete older rolled over files
> ----------------------------------------------------
>
> Key: LOG4J2-524
> URL: https://issues.apache.org/jira/browse/LOG4J2-524
> Project: Log4j 2
> Issue Type: Improvement
> Components: Appenders
> Affects Versions: 2.0-beta9, 2.0-rc1
> Reporter: Remko Popma
> Labels: Rollover
>
> This issue was raised by Kireet on the log4j-user mailing list:
> I am trying to use the rolling file appender in log4j2, basically I want to
> roll at midnight daily and keep 3 old log files. New files are created
> properly, but log4j doesn't seem to be cleaning up the old files. Does log4j
> only support cleanup of files within the time period? Here is the relevant
> portion of the config. I tried things with and without the %i pattern.
> {code}
> <RollingFile name="Event" fileName="app.log"
> filePattern="app-%d{yyyy-MM-dd}.%i.log">
> <PatternLayout>
> <Pattern>%m%n</Pattern>
> </PatternLayout>
> <Policies>
> <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> </Policies>
> <DefaultRolloverStrategy compressionLevel="0" max="3"/>
> </RollingFile>
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]