@Test public void setLoggerLevel_LBCLASSIC_79() { String objectNameAsStr = "ch.qos" + diff + ":Name=" + lc.getName() + ",Type=" + this.getClass().getName(); ObjectName on = MBeanUtil.string2ObjectName(lc, this, objectNameAsStr); JMXConfigurator configurator = new JMXConfigurator(lc, mbs, on); configurator.setLoggerLevel(testLogger.getName(), "DEBUG"); assertEquals(Level.DEBUG, testLogger.getLevel()); configurator.setLoggerLevel(testLogger.getName(), "null"); assertNull(testLogger.getLevel()); MBeanUtil.unregister(lc, mbs, on, this); }
public void setLoggerLevel(String loggerName, String levelStr) { if (loggerName == null) { return; } if (levelStr == null) { return; } loggerName = loggerName.trim(); levelStr = levelStr.trim(); addInfo("Trying to set level " + levelStr + " to logger " + loggerName); LoggerContext lc = (LoggerContext) context; Logger logger = lc.getLogger(loggerName); if ("null".equalsIgnoreCase(levelStr)) { logger.setLevel(null); } else { Level level = Level.toLevel(levelStr, null); if (level != null) { logger.setLevel(level); } } }
JMXConfigurator extends ContextAwareBase implements JMXConfiguratorMBean, LoggerContextListener { public void setLoggerLevel(String loggerName, String levelStr) { if (loggerName == null) { return; } if (levelStr == null) { return; } loggerName = loggerName.trim(); levelStr = levelStr.trim(); addInfo("Trying to set level " + levelStr + " to logger " + loggerName); LoggerContext lc = (LoggerContext) context; Logger logger = lc.getLogger(loggerName); if ("null".equalsIgnoreCase(levelStr)) { logger.setLevel(null); } else { Level level = Level.toLevel(levelStr, null); if (level != null) { logger.setLevel(level); } } } }
JMXConfigurator extends ContextAwareBase implements JMXConfiguratorMBean, LoggerContextListener { public void setLoggerLevel(String loggerName, String levelStr) { if (loggerName == null) { return; } if (levelStr == null) { return; } loggerName = loggerName.trim(); levelStr = levelStr.trim(); addInfo("Trying to set level " + levelStr + " to logger " + loggerName); LoggerContext lc = (LoggerContext) context; Logger logger = lc.getLogger(loggerName); if ("null".equalsIgnoreCase(levelStr)) { logger.setLevel(null); } else { Level level = Level.toLevel(levelStr, null); if (level != null) { logger.setLevel(level); } } } JMXConfigurator(LoggerContext loggerContext, MBeanServer mbs, ObjectName objectName); }
JMXConfigurator extends ContextAwareBase implements JMXConfiguratorMBean, LoggerContextListener { public void setLoggerLevel(String loggerName, String levelStr) { if (loggerName == null) { return; } if (levelStr == null) { return; } loggerName = loggerName.trim(); levelStr = levelStr.trim(); addInfo("Trying to set level " + levelStr + " to logger " + loggerName); LoggerContext lc = (LoggerContext) context; Logger logger = lc.getLogger(loggerName); if ("null".equalsIgnoreCase(levelStr)) { logger.setLevel(null); } else { Level level = Level.toLevel(levelStr, null); if (level != null) { logger.setLevel(level); } } } JMXConfigurator(LoggerContext loggerContext, MBeanServer mbs, ObjectName objectName); void reloadDefaultConfiguration(); void reloadByFileName(String fileName); void reloadByURL(URL url); void setLoggerLevel(String loggerName, String levelStr); String getLoggerLevel(String loggerName); String getLoggerEffectiveLevel(String loggerName); List<String> getLoggerList(); List<String> getStatuses(); void onStop(LoggerContext context); void onLevelChange(Logger logger, Level level); void onReset(LoggerContext context); boolean isResetResistant(); void onStart(LoggerContext context); @Override String toString(); }
JMXConfigurator extends ContextAwareBase implements JMXConfiguratorMBean, LoggerContextListener { public void setLoggerLevel(String loggerName, String levelStr) { if (loggerName == null) { return; } if (levelStr == null) { return; } loggerName = loggerName.trim(); levelStr = levelStr.trim(); addInfo("Trying to set level " + levelStr + " to logger " + loggerName); LoggerContext lc = (LoggerContext) context; Logger logger = lc.getLogger(loggerName); if ("null".equalsIgnoreCase(levelStr)) { logger.setLevel(null); } else { Level level = Level.toLevel(levelStr, null); if (level != null) { logger.setLevel(level); } } } JMXConfigurator(LoggerContext loggerContext, MBeanServer mbs, ObjectName objectName); void reloadDefaultConfiguration(); void reloadByFileName(String fileName); void reloadByURL(URL url); void setLoggerLevel(String loggerName, String levelStr); String getLoggerLevel(String loggerName); String getLoggerEffectiveLevel(String loggerName); List<String> getLoggerList(); List<String> getStatuses(); void onStop(LoggerContext context); void onLevelChange(Logger logger, Level level); void onReset(LoggerContext context); boolean isResetResistant(); void onStart(LoggerContext context); @Override String toString();  }