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

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Wed Aug 3 11:56:40 CEST 2011


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 at qos.ch
        ReportedBy: zhihui.wu at 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.


More information about the slf4j-dev mailing list