http://bugzilla.slf4j.org/show_bug.cgi?id=111





--- Comment #3 from Ceki Gulcu <[EMAIL PROTECTED]>  2008-11-20 16:02:37 ---
Hello again,

In revision 1244 committed a few minutes ago, the install and uninstall methods
have become:
  /**
   * Adds a SLF4JBridgeHandler instance to jul's root logger.
   * 
   * <p>
   * This handler will redirect jul logging to SLF4J. However, only logs
enabled
   * in j.u.l. will be redirected. For example, if a log statement invoking a
   * j.u.l. logger disabled that statement, by definition, will <em>not</em>
reach
   * any SLF4JBridgeHandler instance and cannot be redirected. 
   */
  public static void install() {
    LogManager.getLogManager().getLogger("").addHandler(
        new SLF4JBridgeHandler());
  }

  /**
   * Removes previously installed SLF4JBridgeHandler instances. See also
   * [EMAIL PROTECTED] #install()}.
   * 
   * @throws SecurityException
   *                 A <code>SecurityException</code> is thrown, if a security
   *                 manager exists and if the caller does not have
   *                 LoggingPermission("control").
   */
  public static void uninstall() throws SecurityException {
    java.util.logging.Logger rootLogger = LogManager.getLogManager().getLogger(
        "");
    Handler[] handlers = rootLogger.getHandlers();
    for (int i = 0; i < handlers.length; i++) {
      if (handlers[i] instanceof SLF4JBridgeHandler) {
        rootLogger.removeHandler(handlers[i]);
      }
    }
  }

Is this more amenable to your purposes?


-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dev mailing list
dev@slf4j.org
http://www.slf4j.org/mailman/listinfo/dev

Reply via email to