Author: fhanik Date: Tue Mar 10 18:53:27 2009 New Revision: 752215 URL: http://svn.apache.org/viewvc?rev=752215&view=rev Log: When adding a logger, its better to always add the parent loggers, all the way up the chain. The cost of this is relatively small, since the number of packages compared to classes is relatively small. This feature allows extensions of the JULI framework to change log categories during run time, as opposed to changing them for every single logger in a category
Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=752215&r1=752214&r2=752215&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original) +++ tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Tue Mar 10 18:53:27 2009 @@ -101,15 +101,12 @@ } } - // If any parent loggers have levels definied, make sure they are - // instantiated + // Always instantiate parent loggers so that + // we can control log categories even during runtime int dotIndex = loggerName.lastIndexOf('.'); while (dotIndex >= 0) { final String parentName = loggerName.substring(0, dotIndex); - if (getProperty(parentName + ".level") != null) { - Logger.getLogger(parentName); - break; - } + Logger.getLogger(parentName); dotIndex = loggerName.lastIndexOf('.', dotIndex - 1); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org