tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Logging via log4j and war file question
Date Mon, 23 Jun 2003 16:15:02 GMT

Howdy,
getRealPath() will not work in packed war files.  You need to use
getResouce() or getResourceAsStream().

Although it looks like in this case, log4j.properties is on the
classpath, so log4j will locate and configure automatically.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Jim Lynch [mailto:jwl@sgi.com]
>Sent: Monday, June 23, 2003 12:01 PM
>To: tomcat
>Subject: Logging via log4j and war file question
>
>I recently switch from doing "install", "remove" deployments via a
build
>directory to "deploy", "undeploy" via a war file.  Unfortuantely my
>logging has stopped working.  I've traced it to the following
statement:
>
>PropertyConfigurator.configure(getServletContext().getRealPath("/")+"/W
EB-
>INF/classes/log4j.properties");
>
>It appears the getRealPath method doesn't work with war files, so I'm a
>bit stuck.  How can I configure my logging from a file within the war
>file, or can I?
>
>Thanks,
>Jim.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




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


Mime
View raw message