Author: markt
Date: Tue Jun 4 12:29:29 2013
New Revision: 1489411
URL: http://svn.apache.org/r1489411
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052
Fall back to un-prefixed property if a prefixed one is not present
Modified:
tomcat/tc7.0.x/trunk/ (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
Merged /tomcat/trunk:r1489405
Modified: tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=1489411&r1=1489410&r2=1489411&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java Tue
Jun 4 12:29:29 2013
@@ -244,12 +244,31 @@ public class ClassLoaderLogManager exten
*/
@Override
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
@@ -271,13 +290,9 @@ public class ClassLoaderLogManager exten
result = super.getProperty(name);
}
}
- // Simple property replacement (mostly for folder names)
- if (result != null) {
- result = replace(result);
- }
return result;
}
-
+
@Override
public void readConfiguration()
Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1489411&r1=1489410&r2=1489411&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 4 12:29:29 2013
@@ -121,6 +121,11 @@
command of the Ant tasks for interfacing with the text based Manager
application. Patch provided by Sergey Tcherednichenko. (markt)
</add>
+ <add>
+ <bug>55052</bug>: JULI's LogManager now additionally looks for
+ logging properties without prefixes if the property cannot be found
with
+ a prefix. (markt)
+ </add>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]