logging-log4j2
logging-log4j2 copied to clipboard
RollingFileAppender with createOnDemand="true" eagerly tries creating directories
Description
When specifying createOnDemand="true"
on a RollingFileAppender
, the expectation is that the file won't be created before the appender is actually used.
However, while there is no attempt to create the logging file, Log4J2 still tries to create the file's directory:
https://github.com/apache/logging-log4j2/blob/main/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/RollingFileManager.java#L769
Configuration
Version: 2.20.0
Operating system: Windows 11
JDK: Oracle Java 17.0.3