return hierarchy.getThreshold(); } else if(attributeName.startsWith("logger")) { int k = attributeName.indexOf("%3D");
hierarchy.getThreshold()); hierarchy.setThreshold(l);
hierarchy.setThreshold(OptionConverter.toLevel(thresholdStr, (Level) Level.ALL)); LogLog.debug("Hierarchy threshold set to ["+hierarchy.getThreshold()+"].");
public static void withDisabledLogging(final Runnable r) { // Note: this assumes we're using Log4J and needs to be fixed up if this changes. final LoggerRepository loggerRepo = LogManager.getLoggerRepository(); final Level oldLevel = loggerRepo.getThreshold(); loggerRepo.setThreshold(Level.OFF); try { r.run(); } finally { loggerRepo.setThreshold(oldLevel); } } }
return hierarchy.getThreshold(); } else if(attributeName.startsWith("logger")) { int k = attributeName.indexOf("%3D");
hierarchy.getThreshold()); hierarchy.setThreshold(l);
/** Read configuration options from <code>properties</code>. See {@link #doConfigure(String, LoggerRepository)} for the expected format. */ public void doConfigure(Properties properties, LoggerRepository hierarchy) { String value = properties.getProperty(LogLog.DEBUG_KEY); if(value == null) { value = properties.getProperty(LogLog.CONFIG_DEBUG_KEY); if(value != null) LogLog.warn("[log4j.configDebug] is deprecated. Use [log4j.debug] instead."); } if(value != null) { LogLog.setInternalDebugging(OptionConverter.toBoolean(value, true)); } String thresholdStr = OptionConverter.findAndSubst(THRESHOLD_PREFIX, properties); if(thresholdStr != null) { hierarchy.setThreshold(OptionConverter.toLevel(thresholdStr, (Level) Level.ALL)); LogLog.debug("Hierarchy threshold set to ["+hierarchy.getThreshold()+"]."); } configureRootCategory(properties, hierarchy); configureLoggerFactory(properties); parseCatsAndRenderers(properties, hierarchy); LogLog.debug("Finished configuring."); // We don't want to hold references to appenders preventing their // garbage collection. registry.clear(); }
hierarchy.setThreshold(OptionConverter.toLevel(thresholdStr, Level.ALL)); LogLog.debug("Hierarchy threshold set to ["+hierarchy.getThreshold()+"].");
@Override public Level getThreshold() { return loggerRepository.getThreshold(); }
/** Returns the current threshold. @return current threshold level @since 1.2 */ public Level getThreshold() { return repo.getThreshold(); }
/** Returns the current threshold. @return current threshold level @since 1.2 */ public Level getThreshold() { return repo.getThreshold(); }
public Object getAttribute(String attributeName) throws AttributeNotFoundException, MBeanException, ReflectionException { // Check attributeName is not null to avoid NullPointerException later on if (attributeName == null) { throw new RuntimeOperationsException(new IllegalArgumentException( "Attribute name cannot be null"), "Cannot invoke a getter of " + dClassName + " with null attribute name"); } log.debug("Called getAttribute with ["+attributeName+"]."); // Check for a recognized attributeName and call the corresponding getter if (attributeName.equals(THRESHOLD)) { return hierarchy.getThreshold(); } else if(attributeName.startsWith("logger")) { int k = attributeName.indexOf("%3D"); String val = attributeName; if(k > 0) { val = attributeName.substring(0, k)+'='+ attributeName.substring(k+3); } try { return new ObjectName("log4j:"+val); } catch(Exception e) { log.error("Could not create ObjectName" + val); } } // If attributeName has not been recognized throw an AttributeNotFoundException throw(new AttributeNotFoundException("Cannot find " + attributeName + " attribute in " + dClassName)); }
hierarchy.getThreshold()); hierarchy.setThreshold(l);
return hierarchy.getThreshold(); } else if(attributeName.startsWith("logger")) { int k = attributeName.indexOf("%3D");
return hierarchy.getThreshold(); } else if(attributeName.startsWith("logger")) { int k = attributeName.indexOf("%3D");
hierarchy.getThreshold()); hierarchy.setThreshold(l);
hierarchy.getThreshold()); hierarchy.setThreshold(l);
hierarchy.getThreshold()); hierarchy.setThreshold(l);
hierarchy.getThreshold()); hierarchy.setThreshold(l);
hierarchy.getThreshold()); hierarchy.setThreshold(l);