From 217c7eb1d61435e556e1adea1dd98f53e5624afc Mon Sep 17 00:00:00 2001 From: rjung Date: Wed, 3 Sep 2008 16:38:17 +0000 Subject: [PATCH] Enhance http://svn.apache.org/viewvc?rev=646543&view=rev 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 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/java/org/apache/juli/ClassLoaderLogManager.java b/java/org/apache/juli/ClassLoaderLogManager.java index c25abc71e..e5452e267 100644 --- a/java/org/apache/juli/ClassLoaderLogManager.java +++ b/java/org/apache/juli/ClassLoaderLogManager.java @@ -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"); -- 2.11.0