You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/09/09 14:57:23 UTC

svn commit: r1521083 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/juli/ClassLoaderLogManager.java webapps/docs/changelog.xml

Author: markt
Date: Mon Sep  9 12:57:22 2013
New Revision: 1521083

URL: http://svn.apache.org/r1521083
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052
Make JULI's LogManager to additionally look for logging properties without prefixes if the property cannot be found with a prefix. (kkolinko)

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1521083&r1=1521082&r2=1521083&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep  9 12:57:22 2013
@@ -40,13 +40,6 @@ PATCHES PROPOSED TO BACKPORT:
   +1: markt, kkolinko
   -1:
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052
-  Make JULI's LogManager to additionally look for logging properties
-  without prefixes if the property cannot be found with a prefix.
-  https://issues.apache.org/bugzilla/attachment.cgi?id=30387
-  +1: kkolinko, schultz, markt
-  -1:
-
 * Update Maven Central location used to download dependencies at build time
   to be <code>repo.maven.apache.org</code>.
   (This was suggested by Olivier Lamy in Re:r1307146,

Modified: tomcat/tc6.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=1521083&r1=1521082&r2=1521083&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java Mon Sep  9 12:57:22 2013
@@ -243,12 +243,31 @@ public class ClassLoaderLogManager exten
      * @param name The property name
      */    
     public String getProperty(String name) {
-        ClassLoader classLoader = Thread.currentThread()
-            .getContextClassLoader();
         String prefix = this.prefix.get();
+        String result = null;
+
+        // If a prefix is defined look for a prefixed property first
         if (prefix != null) {
-            name = prefix + name;
+            result = findProperty(prefix + name);
+        }
+
+        // If there is no prefix or no property match with the prefix try just
+        // the name
+        if (result == null) {
+            result = findProperty(name);
         }
+
+        // Simple property replacement (mostly for folder names)
+        if (result != null) {
+            result = replace(result);
+        }
+        return result;
+    }
+
+
+    private String findProperty(String name) {
+        ClassLoader classLoader = Thread.currentThread()
+                .getContextClassLoader();
         ClassLoaderLogInfo info = getClassLoaderInfo(classLoader);
         String result = info.props.getProperty(name);
         // If the property was not found, and the current classloader had no 
@@ -270,14 +289,9 @@ public class ClassLoaderLogManager exten
                 result = super.getProperty(name);
             }
         }
-        // Simple property replacement (mostly for folder names)
-        if (result != null) {
-            result = replace(result);
-        }
         return result;
     }
-    
-    
+
     public void readConfiguration()
         throws IOException, SecurityException {
         

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1521083&r1=1521082&r2=1521083&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Sep  9 12:57:22 2013
@@ -55,6 +55,11 @@
         <bug>55019</bug>: Fix a potential exception when accessing JSPs while
         running under a SecurityManager. (jfclere)
       </fix>
+      <fix>
+        <bug>55052</bug>: Make JULI&apos;s LogManager to additionally look for
+        logging properties without prefixes if the property cannot be found with
+        a prefix. (kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">



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