[JIRA] Created: (LBCLASSIC-78) NullPointerException in JMX Configurator getLoggerLevel

NullPointerException in JMX Configurator getLoggerLevel ------------------------------------------------------- Key: LBCLASSIC-78 URL: http://jira.qos.ch/browse/LBCLASSIC-78 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.11 Reporter: Jean-Luc Geering Assignee: Logback dev list NullPointerException in JMX Configurator getLoggerLevel: on line 111, logger.getLevel() can be null. in ch.qos.logback.classic.jmx.Configurator, lines 110 - 114, replace if (logger != null) { return logger.getLevel().toString(); } else { return EMPTY; } with if (logger != null && logger.getLevel() != null) { return logger.getLevel().toString(); } else { return EMPTY; } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-78?page=com.atlassian.jira.plugin.system... ] Jean-Luc Geering commented on LBCLASSIC-78: ------------------------------------------- to reproduce: import org.slf4j.LoggerFactory; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.jmx.Configurator; import ch.qos.logback.classic.jmx.ConfiguratorMBean; public class Test { public static void main(String[] args) { LoggerFactory.getLogger("com.test"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); ConfiguratorMBean configurator = new Configurator(lc); configurator.getLoggerLevel("com"); } } Exception in thread "main" java.lang.NullPointerException at ch.qos.logback.classic.jmx.Configurator.getLoggerLevel(Configurator.java:111) at Test.main(Test.java:24)
NullPointerException in JMX Configurator getLoggerLevel -------------------------------------------------------
Key: LBCLASSIC-78 URL: http://jira.qos.ch/browse/LBCLASSIC-78 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.11 Reporter: Jean-Luc Geering Assignee: Logback dev list
NullPointerException in JMX Configurator getLoggerLevel: on line 111, logger.getLevel() can be null. in ch.qos.logback.classic.jmx.Configurator, lines 110 - 114, replace if (logger != null) { return logger.getLevel().toString(); } else { return EMPTY; } with if (logger != null && logger.getLevel() != null) { return logger.getLevel().toString(); } else { return EMPTY; }
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-78?page=com.atlassian.jira.plugin.system... ] Ceki Gulcu resolved LBCLASSIC-78. --------------------------------- Fix Version/s: 0.9.12 Resolution: Fixed
NullPointerException in JMX Configurator getLoggerLevel -------------------------------------------------------
Key: LBCLASSIC-78 URL: http://jira.qos.ch/browse/LBCLASSIC-78 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.11 Reporter: Jean-Luc Geering Assignee: Logback dev list Fix For: 0.9.12
NullPointerException in JMX Configurator getLoggerLevel: on line 111, logger.getLevel() can be null. in ch.qos.logback.classic.jmx.Configurator, lines 110 - 114, replace if (logger != null) { return logger.getLevel().toString(); } else { return EMPTY; } with if (logger != null && logger.getLevel() != null) { return logger.getLevel().toString(); } else { return EMPTY; }
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
participants (2)
-
Ceki Gulcu (JIRA)
-
Jean-Luc Geering (JIRA)