You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pe...@apache.org on 2007/09/14 18:20:24 UTC
svn commit: r575741 -
/tomcat/connectors/trunk/juli/src/java/org/apache/juli/ClassLoaderLogManager.java
Author: pero
Date: Fri Sep 14 09:20:23 2007
New Revision: 575741
URL: http://svn.apache.org/viewvc?rev=575741&view=rev
Log:
Handle more then one system property replacement at file logging.properties.
Modified:
tomcat/connectors/trunk/juli/src/java/org/apache/juli/ClassLoaderLogManager.java
Modified: tomcat/connectors/trunk/juli/src/java/org/apache/juli/ClassLoaderLogManager.java
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/juli/src/java/org/apache/juli/ClassLoaderLogManager.java?rev=575741&r1=575740&r2=575741&view=diff
==============================================================================
--- tomcat/connectors/trunk/juli/src/java/org/apache/juli/ClassLoaderLogManager.java (original)
+++ tomcat/connectors/trunk/juli/src/java/org/apache/juli/ClassLoaderLogManager.java Fri Sep 14 09:20:23 2007
@@ -452,19 +452,24 @@
*/
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));
+ }
}
}
}
return result;
}
-
// ---------------------------------------------------- LogNode Inner Class
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org