You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jeff Drew <je...@tradingmetrics.com> on 2004/04/04 17:32:41 UTC

cross-platform log file path?

My Java application runs on Windows, Solaris, and Linux.  Right now, it queries the operating system for the type, then looks in the correct log4j config file path, either:
C:\Programs\AppName\AppLogConfig.properties

or 

/usr/local/AppName/AppLogConfig.properties

However, I need a different version of the log4j configuration file for Windows and Unix in order to set the RollingFile name, either:
log4j.appender.A2.File=C:\Programs\AppName\AppLog.txt

or

log4j.appender.A2.File=/usr/local/AppName/AppLog.txt

 Is there a way to make the log file path variable?   For example:
log4j.appender.A2.File= VARIABLE

I've seen examples where Unix system variables set the path, but that doesn't help me on Windows.

Thanks

Jeffrey Drew
President and Founder
Trading Metrics, Inc.
917-453-0302