[
https://issues.apache.org/jira/browse/LOG4J2-3670?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17766387#comment-17766387
]
Leo Breuss edited comment on LOG4J2-3670 at 9/18/23 1:50 PM:
-------------------------------------------------------------
Observation: The Rollover strategy max parameter is initialized multiple times
during the log4j2 library initialization phase, and finally is set to the
default of 7.
I was not able to understand the initalization sequence while debugging. I just
observed, that the initialization creates multiple strategy objects along the
way, some with max=13, others with max=7, and the latter becomes the final
strategy.
The attached MRE logs to relative path ./logs/. It produces 1kB log each 100ms,
and rolls over at 10kB and each minute. It should keep 13 files per interval...
was (Author: lbreuss):
Observation: The Rollover strategy max parameter is initialized multiple times
during the log4j2 library initialization phase, and finally is set to the
default of 7.
I was not able to understand the initalization sequence while debugging. I just
observed, that the initialization creates multiple strategy objects along the
way, some with max=13, others with max=7, and the latter becomes the final
strategy.
> Rollover max parameter in log4j2.yml, spring-boot 2.7 is ignored
> ----------------------------------------------------------------
>
> Key: LOG4J2-3670
> URL: https://issues.apache.org/jira/browse/LOG4J2-3670
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.17.2, 2.20.0
> Reporter: Leo Breuss
> Priority: Major
> Labels: Rollover, max
> Attachments: console.log, log4j2-rollover.zip
>
>
> The rolling file appender only keeps 7 files, regardless of what I configure
> the max value to in its DefaultRolloverStrategy.
>
> spring-boot 2.7.15 (snakeyaml 1.33, jackson-databind 2.15.2, Java 17)
> Reproduced with log4j2 version 2.17.2 and 2.20.0
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)