Thomas Papke created LOG4J2-1325:
------------------------------------

             Summary: NPE for invalid Log levels set via JMX (afterwards no 
further change possible anymore)
                 Key: LOG4J2-1325
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1325
             Project: Log4j 2
          Issue Type: Bug
          Components: JMX
    Affects Versions: 2.5
            Reporter: Thomas Papke


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).
{code}
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)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to