how to use env vars in log4j.properties file

2003-11-14 Thread Praveen Alavilli
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to use env vars in log4j.properties file

2003-11-14 Thread Praveen Alavilli
I tried - they don't work either.
- Praveen

Shapira, Yoav wrote on 11/14/2003, 2:25 PM:

 >
 > Howdy,
 > I guess you're assuming log4j automatically reads environment properties
 > into an env. prefix scheme like Ant? ;)  Try just environment variable,
 > e.g. $CATALINA_HOME or ${CATALINA_HOME}.
 >
 > Yoav Shapira
 > Millennium ChemInformatics
 >
 >
 > >-Original Message-
 > >From: Praveen Alavilli [mailto:[EMAIL PROTECTED]
 > >Sent: Friday, November 14, 2003 2:22 PM
 > >To: Log4J Users List
 > >Subject: 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: [EMAIL PROTECTED]
 > >For additional commands, e-mail: [EMAIL PROTECTED]
 >
 >
 >
 >
 > This e-mail, including any attachments, is a confidential business
 > communication, and may contain information that is confidential,
 > proprietary and/or privileged.  This e-mail is intended only for the
 > individual(s) to whom it is addressed, and may not be saved, copied,
 > printed, disclosed or used by anyone else.  If you are not the(an)
 > intended recipient, please immediately delete this e-mail from your
 > computer system and notify the sender.  Thank you.
 >
 >
 > -
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 >



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



Re: Config Files

2003-12-10 Thread Praveen Alavilli
I asked the same type of question some time back and here is the 
solution that I got 
http://www.mail-archive.com/[EMAIL PROTECTED]/msg10021.html

I didn't try it because the new classes are not yet in the final release 
of log4J - they are only on sandbox.
- Praveen


Duncan Smith wrote on 12/10/2003, 9:16 AM:

 > Is it possible to put envirinment variables into the configuration file?
 >
 > The reason I ask is that I develop on a windows machine, and deploy onto
 > a linux, so the paths where I want to store the logs are differant.
 >
 > If it is not possible, does anyone have a suggestion for how to do this.
 >
 > Many thanks,
 > Duncan Smith
 > Decker Telecom Ltd
 >
 >
 > -
 > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > For additional commands, e-mail: [EMAIL PROTECTED]
 >



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