Another great option is the variable interpolation available in log4j, which
allows you to do something like:

log4j.appender.daily.File=${log.dir}/coldev.log

where the variable "log.dir" (or whatever you want to name it) is a java
system property.



-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 1:02 PM
To: [EMAIL PROTECTED]
Subject: Configuring Log4j for testing vs. development vs. deployment



I figured out that this problem:
[junit] log4j:ERROR setFile(null,true) call failed.
[junit] java.io.FileNotFoundException: \opt\hpws\tomcat\logs\coldev.log
(The system cannot find the path specified)

Is caused by log4j.properties saying:
# Configure the name of the logout for the daily appender
log4j.appender.daily.File=/opt/hpws/tomcat/logs/coldev.log

That path belongs on the HPUX web server.  In an attempt to avoid
changing log4j.properties for deployment, I created a
c:\opt\hpws\tomcat\logs directory on my Windows development machine.
But now that .properties file doesn't work for me when I run junit tests
from the mapped network drive "G" where the source code lives.

So... Do you have a separate log4j.properties for running tests?  How do
you handle configuring log4j for tests?  (In the most automated way
possible!)

Thank you,
--
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management



---------------------------------------------------------------------
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]

Reply via email to