Spring Boot - set logging level of external jar which is using Java Util Logging (jul)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 14:06:08

SLF4JBridgeHandler only receives LogRecord from enabled levels on jul Loggers (this fact is hidden in the javadoc of the install method)

As the default JUL configuration only logs INFO or higher level, the bridge doesn't receive FINE/FINER/FINEST levels.

In order to test this you can force the level of the root jul logger like this :

LogManager.getLogManager().getLogger("").setLevel(Level.FINE);

(or configure explicitly a custom logging.properties with .level=FINE on your JVM)

This configuration must be completed with slf4j level configuration (via logback.xml or logging.level.xxxxxx properties in application.properties)

( Please note, you should be more specific in your jul production configuration as slf4j documentation warns about performance impact of "jul enabled" but "slf4j disabled" logs )

zeodtr

Please see my related answer: https://stackoverflow.com/a/33770877/3004042

In short, use Spring Boot version 1.3.0 with Logback.

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