Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-758

NPE in JULHelper.asJULLevel() when setting a level back to null

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.0.6
    • logback-classic
    • None

    Description

      When setting a logging level back to null, the JULHelper will throw a NullPointerException. Since null is a valid level for both Logback and JUL, the helper should be changed to accept and check for null.

      java.lang.NullPointerException
      at ch.qos.logback.classic.jul.JULHelper.asJULLevel(JULHelper.java:35)
      at ch.qos.logback.classic.jul.LevelChangePropagator.propagate(LevelChangePropagator.java:66)
      at ch.qos.logback.classic.jul.LevelChangePropagator.onLevelChange(LevelChangePropagator.java:57)
      at ch.qos.logback.classic.LoggerContext.fireOnLevelChange(LoggerContext.java:317)
      at ch.qos.logback.classic.Logger.setLevel(Logger.java:183)

      See the attached patch file for a test case and fix

      Attachments

        Activity

          People

            logback-dev Logback dev list
            brianshowers Brian Showers
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: