You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/antora/modules/how-to/pages/logging.adoc
+6
Original file line number
Diff line number
Diff line change
@@ -201,3 +201,9 @@ To configure Log4j 2 to use an alternative configuration file format, add the ap
201
201
Log4j 2 has support for combining multiple configuration files into a single composite configuration.
202
202
To use this support in Spring Boot, configure configprop:logging.log4j2.config.override[] with the locations of one or more secondary configuration files.
203
203
The secondary configuration files will be merged with the primary configuration, whether the primary's source is Spring Boot's defaults, a standard location such as `log4j.xml`, or the location configured by the configprop:logging.config[] property.
204
+
205
+
[NOTE]
206
+
====
207
+
Log4j2 override configuration file locations can be prefixed with `optional:`.
208
+
For example, `optional:classpath:log4j2-override.xml` indicates that `log4j2-override.xml` should only be loaded if the resource exists.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystem.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+1-1
Original file line number
Diff line number
Diff line change
@@ -126,7 +126,7 @@
126
126
{
127
127
"name": "logging.log4j2.config.override",
128
128
"type": "java.util.List<java.lang.String>",
129
-
"description": "Overriding configuration files used to create a composite configuration."
129
+
"description": "Overriding configuration files used to create a composite configuration. Can be prefixed with 'optional:' to only load the override if it exists."
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot/src/test/java/org/springframework/boot/logging/log4j2/Log4J2LoggingSystemTests.java
0 commit comments