From: fhanik Date: Tue, 10 Mar 2009 18:53:27 +0000 (+0000) Subject: When adding a logger, its better to always add the parent loggers, all the way up... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d5950078ad605648d92b2413ced8289fb9799646;p=tomcat7.0 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 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@752215 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/juli/ClassLoaderLogManager.java b/java/org/apache/juli/ClassLoaderLogManager.java index 0a5f2f7c5..f065cf7f4 100644 --- a/java/org/apache/juli/ClassLoaderLogManager.java +++ b/java/org/apache/juli/ClassLoaderLogManager.java @@ -101,15 +101,12 @@ public class ClassLoaderLogManager extends LogManager { } } - // 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); }