Bug 25107 - OptionConverter.getSystemProperty() does not allow substitution
Summary: OptionConverter.getSystemProperty() does not allow substitution
Status: RESOLVED DUPLICATE of bug 14350
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Configurator (show other bugs)
Version: 1.2
Hardware: All All
: P3 enhancement
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-01 13:20 UTC by cchalmers
Modified: 2007-08-22 14:24 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cchalmers 2003-12-01 13:20:18 UTC
When trying to start a default log4j session with the following property:

log4j.configuration=file://${was.install.root}/properties/log4j.xml

the ${was.install.root} is not substituted.

Looking in OptionConverter.getSystemProperty(), I see that no substitution 
occurs.

How about modifying the method as follows:

  public static String getSystemProperty(String key, String def) {
    try {
      return substVars(System.getProperty(key, def), null);
    } catch (Throwable e) { // MS-Java throws 
com.ms.security.SecurityExceptionEx
      LogLog.debug("Was not allowed to read system property \"" + key + "\".");
      return def;
    }
  }

which will allow for great flexibility (especially when using log4j in a WAS 
environment).

Cheers,
Chris
Comment 1 Curt Arnold 2007-08-22 14:24:38 UTC

*** This bug has been marked as a duplicate of 14350 ***