[Bug 229] New: SLF4JBridgeHandler should remove JUL's Console appender

http://bugzilla.slf4j.org/show_bug.cgi?id=229 Summary: SLF4JBridgeHandler should remove JUL's Console appender Product: SLF4J Version: unspecified Platform: PC OS/Version: Windows XP Status: NEW Severity: blocker Priority: P1 Component: jul-to-slf4j AssignedTo: slf4j-dev@qos.ch ReportedBy: zhihui.wu@hp.com SLF4JBridgeHandler should remove JUL's Console appender ,so no logs will be printed at console may be the following code will solve this problem SLF4JBridgeHandler.install(); Handler consolHandler = null; Logger logger = Logger.getLogger(""); for (Handler hand : logger.getHandlers()) { if (hand instanceof ConsoleHandler) { consolHandler = hand; break; } } if (consolHandler != null) { logger.removeHandler(consolHandler); } thanks -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.

http://bugzilla.slf4j.org/show_bug.cgi?id=229 Christian Stein <sormuras@gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P3 CC| |sormuras@gmx.de Severity|blocker |enhancement --- Comment #1 from Christian Stein <sormuras@gmx.de> 2011-08-03 13:10:19 CEST --- The bridge used to reset the entire JUL logging system while installing. That has changed in commit https://github.com/ceki/slf4j/commit/c9c553c44d8ee1e12ee584592b5612aa46d46c6... - which is a good thing. Maybe you can achive your goal with a single line java.util.logging.LogManager.getLogManager().reset(); before installing the bridge. And/or the bridge class could provide JUL-related helper methods, like resetJUL() (wrapping the single line above) or removeJULConsoleAppend() using the code you provided. Cheers Christian -- Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@pixie.qos.ch