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: Newbie how to place logfile under tomcat logs
Date Tue, 12 Aug 2003 13:42:15 GMT

Howdy,

> Thanks, thats a help but because of the setup of our application, I
cant
>use the first two options, and I'd rather not define another properties
>file just to store ${CATALINA_HOME}/logs/logs.txt. Is there any way I
can
>do it programatically? What are the other options?

No.  It would be against the spirit, if not the letter, or the servlet
specification for a servlet to be able to find out such details about
its container.  Even the approaches I showed before weren't that
portable.  This is like those perennial "how can I find out what port
the server is running on in my servlet's init() method?" (You can't with
certainty/portability).

Other options include adding a JNDI entry for your log file path into
tomcat's server.xml and then doing a JNDI lookup in your servlet's init
method, or mangling your log4j configuration together with tomcat's
commons-logging configuration.  The latter is just cruising for a
bruising, and the former is too container-specific (requires modifying
server.xml) for my preferences, so I didn't include them before.

Typically the Ant option is the one I like best, but I guess you don't
use Any to deploy/package your application?

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


Mime
View raw message