Log4j JDK Logging adapter: Apply LogManager system property late in the startup process

痴心易碎 提交于 2019-12-02 01:07:35

As soon as the java.util.logging.LogManager is loaded (near line 174) it assigns the singleton instance. There is no way to replace it after loading is triggered.

Installing the org.apache.logging.log4j.jul.Log4jBridgeHandler should do the trick. You should be able to add that handler to the root logger using the default LogManager with WebSphere.

Usually this can be done by adding the following to your logging.properties:

.handlers=org.apache.logging.log4j.jul.Log4jBridgeHandler
.level.INFO
org.apache.logging.log4j.jul.Log4jBridgeHandler.level=ALL

Per LOG4J2-2025 this is fixed in LOG4J2 version 3.0.0. As of 25-APR-2019, it appears that is a future release. For LOG4J2 2.3 you can use log4j2-Java6-extras or download log4j2-Java6-extras from Maven.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!