Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-102

JUL-toSLF4J-Bridge missing FINE, FINER and FINEST messages

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • None
    • 1.5.x
    • Unspecified
    • None
    • Operating System: Windows XP
      Platform: PC

    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());
      }

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            florian.pepping@wincor-nixdorf.com florian
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: