Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1325

NPE for invalid Log levels set via JMX (afterwards no further change possible anymore)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Component/s: JMX
    • Labels:
      None

      Description

      1. The loggers run into a NullPointer if someone use an incorrect logger name. After this nullpointer, the Mbean display “Unavailable” for this logger, so the whole config file must be reloaded. Here the log output of my local testing. I would expect that the logger do not except the incorrect value and internally remain with the previous value (maybe throw a IllegalArgumentException to give a feedback to the user).

      validating [row=4, column=1]: Level=asdfasdf
      setAttribute(Level=asdfasdf)
      java.lang.NullPointerException
                     at org.apache.logging.log4j.core.config.LoggerConfig.getLevel(LoggerConfig.java:261)
                     at org.apache.logging.log4j.core.Logger$PrivateConfig.<init>(Logger.java:312)
                     at org.apache.logging.log4j.core.Logger.updateConfiguration(Logger.java:293)
                     at org.apache.logging.log4j.core.LoggerContext.updateLoggers(LoggerContext.java:595)
                     at org.apache.logging.log4j.core.LoggerContext.updateLoggers(LoggerContext.java:585)
                     at org.apache.logging.log4j.core.jmx.LoggerConfigAdmin.setLevel(LoggerConfigAdmin.java:82)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              thopap Thomas Papke
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: