The only downside is that (at least as of 1.2.8) variable interpolation is only available in the PropertyConfigurator, not in the DOMConfigurator. But if your config files are relatively simple, then variable interpolation is definitely the way to go.
--Ian
Just to clarify (maybe I'm misunderstanding what you just said). Although you can't create variables in log4j.xml to reference later in log4j.xml, you can reference system properties like ${my.system.variable} in log4j.xml.
Jake
--- Steve Ebersole <[EMAIL PROTECTED]> wrote: > 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] >
--------------------------------------------------------------------- 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]
