Details
-
Bug
-
Resolution: Won't Fix
-
None
-
1.5.x
-
None
-
Operating System: Windows XP
Platform: PC
-
major
-
P2
-
111
Description
Is state:
Using the JUL-to-SLF4J-Bridge, only messages with a Level of INFO or higher are logged. All other messages are discarded.
Should be state:
Using the JUL-to-SLF4J-Bridge, all messages according to the logback-configuration should be logged.
Cause:
During initalization of the JUL-to-SLF4J-Bridge, the JUL-Logging configuration is resetted. During this operation the level of the root-Logger of JUL is set to the default-level of INFO (see Javadoc for reference).
Solution:
After resetting, the loglevel of the root-logger must be set to Level.ALL, so that JUL logs all messages and the SLF4J-Framework can decide what to log.
Code:
change the install()-method of the SLF4JBridgeHandler from
##############
public static void install()
{
LogManager.getLogManager().reset();
LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler());
}
##############
--> to
##############
public static void install()
{
LogManager.getLogManager().reset();
java.util.logging.Logger logger = java.util.logging.Logger.getLogger("");
logger.setLevel(Level.ALL);
LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler());
}