/** Parse the additivity option for a non-root category. */ void parseAdditivityForLogger(Properties props, Logger cat, String loggerName) { String value = OptionConverter.findAndSubst(ADDITIVITY_PREFIX + loggerName, props); LogLog.debug("Handling "+ADDITIVITY_PREFIX + loggerName+"=["+value+"]"); // touch additivity only if necessary if((value != null) && (!value.equals(""))) { boolean additivity = OptionConverter.toBoolean(value, true); LogLog.debug("Setting additivity for \""+loggerName+"\" to "+ additivity); cat.setAdditivity(additivity); } }
cat.setAdditivity(additivity); parseChildrenOfLoggerElement(loggerElement, cat, false);
/** Reset all values contained in this hierarchy instance to their default. This removes all appenders from all categories, sets the level of all non-root categories to <code>null</code>, sets their additivity flag to <code>true</code> and sets the level of the root logger to {@link Level#DEBUG DEBUG}. Moreover, message disabling is set its default "off" value. <p>Existing categories are not removed. They are just reset. <p>This method should be used sparingly and with care as it will block all logging until it is completed.</p> @since 0.8.5 */ public void resetConfiguration() { getRootLogger().setLevel((Level) Level.DEBUG); root.setResourceBundle(null); setThreshold(Level.ALL); // the synchronization is needed to prevent JDK 1.2.x hashtable // surprises synchronized(ht) { shutdown(); // nested locks are OK Enumeration cats = getCurrentLoggers(); while(cats.hasMoreElements()) { Logger c = (Logger) cats.nextElement(); c.setLevel(null); c.setAdditivity(true); c.setResourceBundle(null); } } rendererMap.clear(); }
/** Parse the additivity option for a non-root category. */ void parseAdditivityForLogger(Properties props, Logger cat, String loggerName) { String value = OptionConverter.findAndSubst(ADDITIVITY_PREFIX + loggerName, props); LogLog.debug("Handling "+ADDITIVITY_PREFIX + loggerName+"=["+value+"]"); // touch additivity only if necessary if((value != null) && (!value.equals(""))) { boolean additivity = OptionConverter.toBoolean(value, true); LogLog.debug("Setting additivity for \""+loggerName+"\" to "+ additivity); cat.setAdditivity(additivity); } }
/** Parse the additivity option for a non-root category. */ void parseAdditivityForLogger(Properties props, Logger cat, String loggerName) { String value = OptionConverter.findAndSubst(ADDITIVITY_PREFIX + loggerName, props); LogLog.debug("Handling "+ADDITIVITY_PREFIX + loggerName+"=["+value+"]"); // touch additivity only if necessary if((value != null) && (!value.equals(""))) { boolean additivity = OptionConverter.toBoolean(value, true); LogLog.debug("Setting additivity for \""+loggerName+"\" to "+ additivity); cat.setAdditivity(additivity); } }
/** Parse the additivity option for a non-root category. */ void parseAdditivityForLogger(Properties props, Logger cat, String loggerName) { String value = OptionConverter.findAndSubst(ADDITIVITY_PREFIX + loggerName, props); LogLog.debug("Handling "+ADDITIVITY_PREFIX + loggerName+"=["+value+"]"); // touch additivity only if necessary if((value != null) && (!value.equals(""))) { boolean additivity = OptionConverter.toBoolean(value, true); LogLog.debug("Setting additivity for \""+loggerName+"\" to "+ additivity); cat.setAdditivity(additivity); } }
/** Parse the additivity option for a non-root category. */ void parseAdditivityForLogger(Properties props, Logger cat, String loggerName) { String value = OptionConverter.findAndSubst(ADDITIVITY_PREFIX + loggerName, props); LogLog.debug("Handling "+ADDITIVITY_PREFIX + loggerName+"=["+value+"]"); // touch additivity only if necessary if((value != null) && (!value.equals(""))) { boolean additivity = OptionConverter.toBoolean(value, true); LogLog.debug("Setting additivity for \""+loggerName+"\" to "+ additivity); cat.setAdditivity(additivity); } }
/** Parse the additivity option for a non-root category. */ void parseAdditivityForLogger(Properties props, Logger cat, String loggerName) { String value = OptionConverter.findAndSubst(ADDITIVITY_PREFIX + loggerName, props); LogLog.debug("Handling "+ADDITIVITY_PREFIX + loggerName+"=["+value+"]"); // touch additivity only if necessary if((value != null) && (!value.equals(""))) { boolean additivity = OptionConverter.toBoolean(value, true); LogLog.debug("Setting additivity for \""+loggerName+"\" to "+ additivity); cat.setAdditivity(additivity); } }
/** * initializes the log system using the logfile argument */ private void internalInit( String logfile ) throws Exception { /* * do it by our classname to avoid conflicting with anything else * that might be used... */ logger = Category.getInstance(this.getClass().getName()); logger.setAdditivity(false); /* * Priority is set for DEBUG becouse this implementation checks * log level. */ logger.setPriority(Priority.DEBUG); RollingFileAppender appender = new RollingFileAppender( new PatternLayout( "%d - %m%n"), logfile, true); appender.setMaxBackupIndex( 1 ); appender.setMaximumFileSize( 100000 ); logger.addAppender(appender); }
/** * initializes the log system using the logfile argument */ private void internalInit( String logfile ) throws Exception { /* * do it by our classname to avoid conflicting with anything else * that might be used... */ logger = Category.getInstance(this.getClass().getName()); logger.setAdditivity(false); /* * Priority is set for DEBUG becouse this implementation checks * log level. */ logger.setLevel(Level.DEBUG); appender = new RollingFileAppender( new PatternLayout( "%d - %m%n"), logfile, true); appender.setMaxBackupIndex( 1 ); appender.setMaximumFileSize( 100000 ); logger.addAppender(appender); }
/** * initializes the log system using the logfile argument */ private void internalInit( String logfile ) throws Exception { /* * do it by our classname to avoid conflicting with anything else * that might be used... */ logger = Category.getInstance(this.getClass().getName()); logger.setAdditivity(false); /* * Priority is set for DEBUG becouse this implementation checks * log level. */ logger.setLevel(Level.DEBUG); appender = new RollingFileAppender( new PatternLayout( "%d - %m%n"), logfile, true); appender.setMaxBackupIndex( 1 ); appender.setMaximumFileSize( 100000 ); logger.addAppender(appender); }
/** * Removes the appender that may have been setup by {@link #interceptLogging(String)}. Also, * invokes {@link org.apache.hivemind.util.PropertyUtils#clearCache()}. */ protected void tearDown() throws Exception { super.tearDown(); if (_appender != null) { _appender = null; Logger logger = LogManager.getLogger(_interceptedLoggerName); logger.setLevel(null); logger.setAdditivity(true); logger.removeAllAppenders(); } PropertyUtils.clearCache(); ServiceSerializationHelper.setServiceSerializationSupport(null); }
/** * initializes the log system using the logfile argument * * @param logFile file for log messages */ private void internalInit() throws Exception { logger = Category.getInstance(""); logger.setAdditivity(false); /* * Priority is set for DEBUG becouse this implementation checks * log level. */ logger.setPriority(Priority.DEBUG); String pattern = rsvc.getString( RuntimeConstants.LOGSYSTEM_LOG4J_PATTERN ); if (pattern == null || pattern.length() == 0) { pattern = "%d - %m%n"; } layout = new PatternLayout(pattern); configureFile(); configureRemote(); configureSyslog(); configureEmail(); }
cat.setAdditivity(additivity); parseChildrenOfLoggerElement(loggerElement, cat, false);
cat.setAdditivity(additivity); parseChildrenOfLoggerElement(loggerElement, cat, false);
/** * Sets up an appender to intercept logging for the specified logger. Captured log events can be * recovered via {@link #getInterceptedLogEvents()}. */ protected void interceptLogging(String loggerName) { Logger logger = LogManager.getLogger(loggerName); logger.removeAllAppenders(); _interceptedLoggerName = loggerName; _appender = new StoreAppender(); _appender.activateOptions(); logger.setLevel(Level.DEBUG); logger.setAdditivity(false); logger.addAppender(_appender); }
/** Reset all values contained in this hierarchy instance to their default. This removes all appenders from all categories, sets the level of all non-root categories to <code>null</code>, sets their additivity flag to <code>true</code> and sets the level of the root logger to {@link Level#DEBUG DEBUG}. Moreover, message disabling is set its default "off" value. <p>Existing categories are not removed. They are just reset. <p>This method should be used sparingly and with care as it will block all logging until it is completed.</p> @since 0.8.5 */ public void resetConfiguration() { getRootLogger().setLevel((Level) Level.DEBUG); root.setResourceBundle(null); setThreshold(Level.ALL); // the synchronization is needed to prevent JDK 1.2.x hashtable // surprises synchronized(ht) { shutdown(); // nested locks are OK Enumeration cats = getCurrentLoggers(); while(cats.hasMoreElements()) { Logger c = (Logger) cats.nextElement(); c.setLevel(null); c.setAdditivity(true); c.setResourceBundle(null); } } rendererMap.clear(); }
/** Reset all values contained in this hierarchy instance to their default. This removes all appenders from all categories, sets the level of all non-root categories to <code>null</code>, sets their additivity flag to <code>true</code> and sets the level of the root logger to {@link Level#DEBUG DEBUG}. Moreover, message disabling is set its default "off" value. <p>Existing categories are not removed. They are just reset. <p>This method should be used sparingly and with care as it will block all logging until it is completed.</p> @since 0.8.5 */ public void resetConfiguration() { getRootLogger().setLevel((Level) Level.DEBUG); root.setResourceBundle(null); setThreshold(Level.ALL); // the synchronization is needed to prevent JDK 1.2.x hashtable // surprises synchronized(ht) { shutdown(); // nested locks are OK Enumeration cats = getCurrentLoggers(); while(cats.hasMoreElements()) { Logger c = (Logger) cats.nextElement(); c.setLevel(null); c.setAdditivity(true); c.setResourceBundle(null); } } rendererMap.clear(); }
/** Reset all values contained in this hierarchy instance to their default. This removes all appenders from all categories, sets the level of all non-root categories to <code>null</code>, sets their additivity flag to <code>true</code> and sets the level of the root logger to {@link Level#DEBUG DEBUG}. Moreover, message disabling is set its default "off" value. <p>Existing categories are not removed. They are just reset. <p>This method should be used sparingly and with care as it will block all logging until it is completed.</p> @since 0.8.5 */ public void resetConfiguration() { getRootLogger().setLevel((Level) Level.DEBUG); root.setResourceBundle(null); setThreshold(Level.ALL); // the synchronization is needed to prevent JDK 1.2.x hashtable // surprises synchronized(ht) { shutdown(); // nested locks are OK Enumeration cats = getCurrentLoggers(); while(cats.hasMoreElements()) { Logger c = (Logger) cats.nextElement(); c.setLevel(null); c.setAdditivity(true); c.setResourceBundle(null); } } rendererMap.clear(); }
Logger c = (Logger) cats.nextElement(); c.setLevel(null); c.setAdditivity(true); c.setResourceBundle(null);