Add support for Log4j2's composite configuration

Closes gh-27110
This commit is contained in:
Andy Wilkinson
2021-10-18 21:27:13 +01:00
parent d6aab2fe84
commit 89b40e1e00
6 changed files with 148 additions and 31 deletions

View File

@@ -185,3 +185,11 @@ To configure Log4j 2 to use an alternative configuration file format, add the ap
| `com.fasterxml.jackson.core:jackson-databind`
| `log4j2.json` + `log4j2.jsn`
|===
[[howto.logging.log4j.composite-configuration]]
==== Use Composite Configuration to Configure Log4j 2
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.