logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Cash" <rob.c...@nortelnetworks.com>
Subject RE: Specifying log file location when moving from development to prod uction
Date Thu, 03 Jul 2003 17:44:21 GMT
I ran into this just this morning. Why not use a variable for the File
attribute? Something like this:

log4j.appender.daily.File=${catalina.home}/logs/bentest.log

Or even better, for maximum portability:

log4j.appender.daily.File=${catalina.home}{$file.separator}logs{$file.separa
tor}bentest.log



Cheers,
Rob

Rob Cash
Technical Architect & Application Developer
Nortel Networks (http://www.nortelnetworks.com)
Information Services


-----Original Message-----
From: Wendy Smoak [mailto:Wendy.Smoak@asu.edu] 
Sent: Thursday, July 03, 2003 1:38 PM
To: log4j-user@jakarta.apache.org
Subject: 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 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message