logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51279] New: log4j.properties doesn't support environment variable
Date Sat, 28 May 2011 08:04:20 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51279

             Bug #: 51279
           Summary: log4j.properties doesn't support environment variable
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Configurator
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: zhym001@gmail.com
    Classification: Unclassified


Suggested solution:
in src\java\org\apache\log4j\helpers\OptionConverter.java
relace 
// first try in System properties
     String replacement = getSystemProperty(key, null);
with 
// then try in environment properties
     if (replacement == null) {
         replacement = getEnvProperty(key, null);
     }

And add function 
public String getEnvProperty(String key, String def) {
    try {
        String value = System.getenv(key);
        if (value == null) {
            value = def;
        }
      return value;
    } catch(Throwable e) {
      return def;
    }
  }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message