Enhance http://svn.apache.org/viewvc?rev=646543&view=rev
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 3 Sep 2008 16:38:17 +0000 (16:38 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 3 Sep 2008 16:38:17 +0000 (16:38 +0000)
Don't drop the error silently. Instead use the root logger
already initialized for the system class loader
to write out a warning.
Backport to TC 5.5 will need a couple of casts because
of the lack of generics and the use of HashMaps.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@691675 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/juli/ClassLoaderLogManager.java

index c25abc7..e5452e2 100644 (file)
@@ -303,7 +303,19 @@ public class ClassLoaderLogManager extends LogManager {
             }
         } catch (AccessControlException ace) {
             // No permission to configure logging in context
-            // Ignore and carry on
+            // Log and carry on
+            ClassLoaderLogInfo info = classLoaderLoggers.get(ClassLoader.getSystemClassLoader());
+            if (info != null) {
+                Logger log = info.loggers.get("");
+                if (log != null) {
+                        log.warning("You need to permit read access to your context specific java.util.logging logging configuration to " + ClassLoaderLogManager.class);
+                        log.warning("See \"per context logging\" in the default catalina.policy file.");
+                        log.warning("Original error was: " + ace.getMessage());
+               }
+            }
+         }
+         if ((is == null) && (classLoader == ClassLoader.getSystemClassLoader())) {
+             String configFileStr = System.getProperty("java.util.logging.config.file");
         }
         if ((is == null) && (classLoader == ClassLoader.getSystemClassLoader())) {
             String configFileStr = System.getProperty("java.util.logging.config.file");