Handle more then one system property replacement at file logging.properties.
authorpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 14 Sep 2007 11:01:06 +0000 (11:01 +0000)
committerpero <pero@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 14 Sep 2007 11:01:06 +0000 (11:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@575617 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/juli/ClassLoaderLogManager.java
webapps/docs/changelog.xml

index e1bb7ea..f5bcc16 100644 (file)
@@ -442,13 +442,19 @@ public class ClassLoaderLogManager extends LogManager {
      */
     protected String replace(String str) {
         String result = str;
-        if (result.startsWith("${")) {
-            int pos = result.indexOf('}');
-            if (pos != -1) {
-                String propName = result.substring(2, pos);
+        int pos_start = result.indexOf("${");
+        if (pos_start != -1) {
+            int pos_end = result.indexOf('}');
+            if (pos_end != -1) {
+                String propName = result.substring(pos_start + 2, pos_end);
                 String replacement = System.getProperty(propName);
                 if (replacement != null) {
-                    result = replacement + result.substring(pos + 1);
+                    if(pos_start >0) {
+                        result = result.substring(0,pos_start) + 
+                            replacement + replace(result.substring(pos_end + 1));
+                    } else {                       
+                        result = replacement + replace(result.substring(pos_end + 1));
+                    }
                 }
             }
         }
index 5925d90..1a226bb 100644 (file)
@@ -82,6 +82,9 @@
       <update>
         Optimized JDBCAccessLogValve combined pattern request attribute access. (pero)
       </update>
+      <fix>
+        o.a.juli.ClassLoaderLogManager handle more then one system property replacement at file logging.properties. (pero)
+      </fix>     
     </changelog>
   </subsection>
   <subsection name="Coyote">