[
https://issues.apache.org/jira/browse/LOG4J2-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15035982#comment-15035982
]
Robert Schaft commented on LOG4J2-435:
--------------------------------------
It looks only complicated because the test examples are complex. Simple
examples still look simple:
{code:xml}
<Delete baseDir="logs">
<And>
<FileName glob="debug-*.log.gz" />
<LastModified age="7dT1h" />
<And>
</Delete>
{code}
or
{code:xml}
<Delete baseDir="logs">
<FileName glob="debug-*.log.gz" /> <!-- Only one condition. No combining
condition required. -->
<ThenIf>
<AccumulatedFileSize exceeds="1gb" />
</ThenIf>
</Delete>
{code}
My main goals were
# Map the whole thing to the programmers world of understanding
# to have names that tell the user what is happening ({{or}} or {{and}}?).
# to work around the undefined ordering of child elements because a shortcut
operator is required
# If the solution is also usable for more complex cases - why not? At least
don't close doors for future improvements.
Even a possible ScriptCondition should probably not be triggered on every file
but only on an interesting subset. So we still need the shortcut operator
{{<ThenIf>}}.
> Feature request: auto-delete older log files
> ---------------------------------------------
>
> Key: LOG4J2-435
> URL: https://issues.apache.org/jira/browse/LOG4J2-435
> Project: Log4j 2
> Issue Type: Improvement
> Reporter: Arkin Yetis
> Assignee: Remko Popma
> Labels: Rollover
> Fix For: 2.5
>
> Attachments: LimitingRolloverStrategy.java, SizeParser.java
>
>
> Original description:
> {quote}
> DefaultRolloverStrategy max attribute only applies if you have a %i in the
> file pattern. This request is to enhance DefaultRolloverStrategy or another
> appropriate component to allow a max number of files limit to apply across
> days/months/years when a filePattern includes a date pattern.
> {quote}
> ----
> One of the most requested features is to add the ability to Log4j to "clean
> up" older log files. This usually means deleting these files, although it
> could also mean moving them to a different location, or some combination of
> these.
> Users have different requirements for selecting the files to clean up. A
> common request is the ability to keep the last X number of log files. This
> works well if rollover is only date based but may give undesired results with
> size based rollover.
> Another factor to consider is that the directory containing the log files may
> contain the log files for multiple appenders, or even files unrelated to
> logging.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]