/** * set Topic Level * @param topic topic to set * @param level the level to set */ public void setTopicLevel(final String topic, final String level) { Logger topicLogger = Log.getLoggerFactory().getLogger(topic); Level lev = Log.getLevelFactory().getLevel(level); // must check null (bug monolog) if (lev != null) { topicLogger.setLevel(lev); } else { // TO DO maybe a better error treatement could be found throw new RuntimeException("Unknown level " + level); } // the modified property name is 'logger.topic.level' String propName = "logger." + topic + ".level"; // Send a notification containing the new value of this property to the // listener MBean sendReconfigNotification(++sequenceNumber, SERVICE_NAME, new PropertiesConfigurationData(propName, level)); }
/** * set Topic Level * @param topic topic to set * @param level the level to set */ public void setTopicLevel(final String topic, final String level) { Logger topicLogger = Log.getLoggerFactory().getLogger(topic); Level lev = Log.getLevelFactory().getLevel(level); // must check null (bug monolog) if (lev != null) { topicLogger.setLevel(lev); } else { // TO DO maybe a better error treatement could be found throw new RuntimeException("Unknown level " + level); } // the modified property name is 'logger.topic.level' String propName = "logger." + topic + ".level"; // Send a notification containing the new value of this property to the // listner MBean sendReconfigNotification(++sequenceNumber, SERVICE_NAME, new PropertiesConfigurationData(propName, level)); }