Enhance the configuration of log4j2 (xml), support Profile-specific Configuration (<SpringProfile>
), consistent with logback extension.
Spring Boot currently only enhances the Logback (XML) configuration to support the
I copied the code in Log4j2 XML to parse the XML configuration and created a new SpringBootXmlConfiguration to support the
Compatibility issues with rewriting the Log4j2 parsing code:
- I just copied the
XmlConfiguration
code directly from Log4j2, adding very little code and making no big changes like formatting. If there is an update to Log4j2, it is easy to rewrite the parsing class and update it accordingly. - The
XmlConfiguration
class in Log4j2 was last updated in June 2019, with no updates between [2.12.0,2.14.1] and the default dependent version of Log4j2 in Springboot (master) is 2.14.1
To sum up, there is no risk in this kind of enhancement
Comment From: kongwu-
Hot to execute recheck?
Comment From: snicoll
Hot to execute recheck?
@kongwu please don't open duplicate PRs, it creates unnecessary noise for those watching this repository. Rather than relying on our CI to validate your changes does not fail the build, please run the build locally before submitting a contribution.
Duplicate of #25874