Since version 2.15.0 log4j-jul contains a Log4jBridgeHandler, that allows to forward JUL to Log4j 2.x and synchronizes the logger levels of the two frameworks.

This PR adds support for the Log4jBridgeHandler and sets it as default bridge handler for the Log4j 2.x stack and fallback handler for Logback.

It also removes jul-to-slf4j from the spring-boot-starter-log4j2, hence leaving a pure Log4j 2.x stack.

Comment From: pivotal-cla

@ppkarwasz Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-cla

@ppkarwasz Thank you for signing the Contributor License Agreement!

Comment From: ppkarwasz

@wilkinsona,

While simplification is my main motivation for this change proposal (a Log4j stack requires one less dependency), it also comes with a bonus feature: the Log4jBridgeHandler synchronizes the logging levels between JUL and Log4j 2.x and therefore enhances performance.

Comment From: wilkinsona

@ppkarwasz Thanks very much for making your first contribution to Spring Boot. Based on your changes, I reworked things a little bit in 3980c5af486343062b401f6bb3874cf880c73efd to simplify the bridge handler configuration. This also removed the need for SLFJLoggingSystem as there's no longer common bridge handler management.

Comment From: ppkarwasz

@wilkinsona, thank you. Is there any chance this change will be backported to 2.6.x? Of course in 2.6.x the SLFJLoggingSystem should probably stay for backward compatibility?

Comment From: wilkinsona

No, sorry. The change isn't fixing a bug so we won't make it in a maintenance release.