logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Specifying log file location when moving from development to production
Date Thu, 03 Jul 2003 17:52:42 GMT


>I have to remember to swap which line is commented out when I move the
>to production.  I forget where the log file wants to go naturally (with
>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
>to go somewhere else entirely, so the relative path doesn't work.
>Has anyone got a way to deal with this programmatically, either one
>that will work for both Windows and Unix, or something that Ant can do,
>or... ?

If I'm doing something simple / quick / in house I use Ant's copy with
filtering.  So my log4j.properties file looks like:

And the ant <copy> task that copies log4j.properties to its deployment
location has filtering="true" and a logFile token with the appropriate

Another approach is to use an environment variable, e.g.

When I'm doing something long-term / for external customers, I typically
stick an <env-entry> in web.xml and let the server administrator plug in
the appropriate value (for tomcat, this would be an <Environment> entry
in server.xml).  This JNDI approach is very portable.  It works for me
as I like to configure log4j programmatically anyways.

Yoav Shapira

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: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org

View raw message