Replies: 1 comment
-
The documentation on DefaultRolloverStrategy says ". If the date/time pattern is present it will be replaced with the current date and time values". In other words, the max attribute only limits the number of files within the same time period. To delete files the way you want to you will need to use a Delete action. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello
in my log4j2.xml I have the following appender
and I have a test class to create log entries
i expected the zips older (or equal) than 3 minutes to be deleted based on the filePattern. does this date/time rollover no longer work?
in org.apache.logging.log4j.core.appender.rolling.AbstractRolloverStrategy.getEligibleFiles(String, String, String, boolean)
the pattern will not match './log/old/log4j2-test-old-%d{yyyy-MM-dd_HH-mm}.log.zip' and the eligibleFiles is alwas empty.
log4j2 is 2.23.1,
os is windows 10,
java is openjdk 17
Beta Was this translation helpful? Give feedback.
All reactions