@ -201,3 +201,9 @@ To configure Log4j 2 to use an alternative configuration file format, add the ap
@@ -201,3 +201,9 @@ To configure Log4j 2 to use an alternative configuration file format, add the ap
Log4j 2 has support for combining multiple configuration files into a single composite configuration.
To use this support in Spring Boot, configure configprop:logging.log4j2.config.override[] with the locations of one or more secondary configuration files.
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.
[NOTE]
====
Log4j2 override configuration file locations can be prefixed with `optional:`.
For example, `optional:classpath:log4j2-override.xml` indicates that `log4j2-override.xml` should only be loaded if the resource exists.
@ -269,21 +273,22 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
@@ -269,21 +273,22 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
@ -303,7 +308,24 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
@@ -303,7 +308,24 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
@ -321,19 +343,21 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
@@ -321,19 +343,21 @@ public class Log4J2LoggingSystem extends AbstractLoggingSystem {
"description":"Overriding configuration files used to create a composite configuration."
"description":"Overriding configuration files used to create a composite configuration. Can be prefixed with 'optional:' to only load the override if it exists."