This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/release-2.x by this push:
new c064152 [DOC] fix Duration string (#639)
c064152 is described below
commit c0641527111f1f6ec870824feef8798d75dfd7a5
Author: Michael Bürkle <[email protected]>
AuthorDate: Sat Dec 18 02:24:57 2021 +0100
[DOC] fix Duration string (#639)
According to
https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/appender/rolling/action/Duration.html#parseCharSequence
a Duration looks like "P2D" or "PT20S".
In serveral instances our configuration did not work as expected and
didn't delete files despite them beeing older then the period that we
thought was configured. After some digging into the configuration we
found that the above mention string fixed the configuration.
Co-authored-by: Michael Buerkle <[email protected]>
---
src/site/xdoc/manual/appenders.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/site/xdoc/manual/appenders.xml
b/src/site/xdoc/manual/appenders.xml
index bcde753..c0f8c6d 100644
--- a/src/site/xdoc/manual/appenders.xml
+++ b/src/site/xdoc/manual/appenders.xml
@@ -3825,7 +3825,7 @@ public class JpaLogEntity extends
AbstractLogEventWrapperEntity {
<DefaultRolloverStrategy>
<Delete basePath="${baseDir}" maxDepth="2">
<IfFileName glob="*/app-*.log.gz" />
- <IfLastModified age="60d" />
+ <IfLastModified age="P60D" />
</Delete>
</DefaultRolloverStrategy>
</RollingFile>
@@ -3867,7 +3867,7 @@ public class JpaLogEntity extends
AbstractLogEventWrapperEntity {
-->
<Delete basePath="${baseDir}" maxDepth="2">
<IfFileName glob="*/app-*.log.gz">
- <IfLastModified age="30d">
+ <IfLastModified age="P30D">
<IfAny>
<IfAccumulatedFileSize exceeds="100 GB" />
<IfAccumulatedFileCount exceeds="10" />