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 Praveen Alavilli <al...@aol.com> on 2003/11/14 20:22:26 UTC

how to use env vars in log4j.properties file

Hi,
I am trying to configure a DailyRollingFileAppender for my test app.
I want to set the log file to be in my server's (tomcat) log dir along 
with other log files. But if set the File path as

log4j.appender.MyappLog.File=${env.CATALINA_HOME}/logs/myapp.log

it throws this error:

log4j: setFile called: /logs/myapp.log, true
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /logs/myapp.log (No such file or directory)

Is there any ther way to get this working apart from hard coding the 
file name/dir ?

thanks in advance
Praveen


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