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

Category.log(String FQCN, Priority p, Object msg, Throwable t) method throws UnsupportedOperationException

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • None
    • 1.5.x
    • log4j-over-slf4j
    • None
    • Operating System: Windows NT
      Platform: PC

    Description

      Seth Call reports:

      http://www.qos.ch/pipermail/slf4j-user/2010-February/000889.html

      It appears that but not certain that a logback appender is invoking a library
      using log4j during its initialization which retrieves a NOPLogger.

      See

      http://www.qos.ch/pipermail/slf4j-user/2010-February/000892.html

      Solution is to change the Category.log(String FQCN, Priority p, Object msg, Throwable t) method from

      public void log(String FQCN, Priority p, Object msg, Throwable t)

      { int levelInt = priorityToLevelInt(p); differentiatedLog(null, FQCN, levelInt, msg, t); }

      public void log(String FQCN, Priority p, Object msg, Throwable t) {
      int levelInt = priorityToLevelInt(p);
      if (locationAwareLogger != null)

      { locationAwareLogger.log(null, FQCN, levelInt, convertToString(msg), t); }

      else

      { throw new UnsupportedOperationException("The logger [" + slf4jLogger + "] does not seem to be location aware."); }

      }

      Attachments

        Activity

          People

            slf4j-dev SLF4J developers list
            listid@qos.ch Ceki Gulcu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: