DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25107>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25107

OptionConverter.getSystemProperty() does not allow substitution

           Summary: OptionConverter.getSystemProperty() does not allow
                    substitution
           Product: Log4j
           Version: 1.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Configurator
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to