tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r691887 - /tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java
Date Thu, 04 Sep 2008 07:02:33 GMT
Author: rjung
Date: Thu Sep  4 00:02:33 2008
New Revision: 691887

URL: http://svn.apache.org/viewvc?rev=691887&view=rev
Log:
Reduce log statement to 1 line using
more precise info, in the expected case and only
log the detailed info in the unexpected case.

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=691887&r1=691886&r2=691887&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original)
+++ tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Thu Sep  4 00:02:33 2008
@@ -19,11 +19,13 @@
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FilePermission;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URLClassLoader;
 import java.security.AccessControlException;
 import java.security.AccessController;
+import java.security.Permission;
 import java.security.PrivilegedAction;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -308,10 +310,15 @@
             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.");
+                    Permission perm = ace.getPermission();
+                    if (perm instanceof FilePermission && perm.getActions().equals("read"))
{
+                        log.warning("Reading " + perm.getName() + " is not permitted. See
\"per context logging\" in the default catalina.policy file.");
+                    }
+                    else {
+                        log.warning("Reading logging.properties is not permitted in some
context. See \"per context logging\" in the default catalina.policy file.");
                         log.warning("Original error was: " + ace.getMessage());
-               }
+                    }
+                }
             }
         }
         if ((is == null) && (classLoader == ClassLoader.getSystemClassLoader()))
{



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message