Skip to content

[LOG4J2-2006] RollingFile createOnDemand validation#4072

Open
ramanathan1504 wants to merge 1 commit intoapache:2.xfrom
ramanathan1504:issue-2006
Open

[LOG4J2-2006] RollingFile createOnDemand validation#4072
ramanathan1504 wants to merge 1 commit intoapache:2.xfrom
ramanathan1504:issue-2006

Conversation

@ramanathan1504
Copy link
Contributor

PR Notes: RollingFile createOnDemand validation

Scope

  • Module tested: spring-boot-test only
  • core-java-test and log4j2-web-test left unchanged

What was run

  • Local dependency check confirmed 2.26.0-SNAPSHOT artifacts resolved from ~/.m2
  • Startup timing probes from SpringBootTestApp#printLogPathState used as source of truth

Results (2.26.0-SNAPSHOT)

createOnDemand="true" (default log4j2.xml)

  • main-entry: dir=false app.log=false app-json.log=false
  • after LogManager.getLogger: dir=false app.log=false app-json.log=false
  • after first log event: dir=true app.log=true app-json.log=true

Conclusion: directory and files are created on first log event (expected on-demand behavior).

createOnDemand="false" (log4j2-createOnDemand-false.xml)

  • main-entry: dir=false app.log=false app-json.log=false
  • after LogManager.getLogger: dir=true app.log=true app-json.log=true
  • after first log event: dir=true app.log=true app-json.log=true

Conclusion: eager creation occurs before first log event (expected non-demand behavior).

@ramanathan1504 ramanathan1504 changed the title [LOG4J2-issue-2006] RollingFile createOnDemand validation [LOG4J2-2006] RollingFile createOnDemand validation Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant