You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "Piotr P. Karwasz" <pi...@gmail.com> on 2024/05/07 07:00:33 UTC

Integration between `log4j-jpl` and `log4j-jul`

Hi,

I just discovered that JBoss LogManager implemented a very nifty
feature[1] that integrates Java 9 System.Logger with
`java.util.logging`. Since:

* `System.Logger` is loaded using `ServiceLoader`
* JUL's `LogManager` requires a `java.util.logging.manager` system
property to be set on the command line (cf. JDK8262741[2]),

they decided to use the service loaded by JPL to set the property
required by JUL. That is brilliant!

I like this approach, should we implement it in `log4j-jpl`? It would
make the deployment of `log4j-jul` so much easier.

Remark that setting `java.util.logging.manager` after JUL has already
been initialized, is a no-op, so this should be mostly safe for web
applications.

Piotr

[1] https://github.com/jboss-logging/jboss-logmanager/blob/main/src/main/java/org/jboss/logmanager/JBossLoggerFinder.java
[2] https://bugs.openjdk.org/browse/JDK-8262741