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 Wendy Smoak <We...@asu.edu> on 2003/07/03 19:37:59 UTC

Specifying log file location when moving from development to prod uction

I use Log4j behind Commons Logging in a Struts app running under Tomcat.
I'm happy with everything except one minor irritation when I deploy a new
version of my webapp.

In log4j.properties, I have:
# Configure the name of the logout for the daily appender
# default location when used with Tomcat on Windows 
# is is /path/to/tomcat/bin, so back up one & go into logs
#log4j.appender.daily.File=/opt/hpws/tomcat/logs/bentest.log
log4j.appender.daily.File=../logs/bentest.log

I have to remember to swap which line is commented out when I move the app
to production.  I forget where the log file wants to go naturally (with no
path) on Unix, but it wasn't the same place as on Windows.  Then if you
start Tomcat as an NT service as a coworker of mine does, the log file wants
to go somewhere else entirely, so the relative path doesn't work.

Has anyone got a way to deal with this programmatically, either one setting
that will work for both Windows and Unix, or something that Ant can do,
or... ?

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM