tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Bainbridge <ja...@jblinux.org>
Subject Re: Logging via log4j and war file question
Date Mon, 23 Jun 2003 16:10:01 GMT
On Tue, 24 Jun 2003 00:01, Jim Lynch wrote:
> 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("/")+"/WEB-I
>NF/classes/log4j.properties");

From a previous post (I'd include a link but I searched my local mailbox as 
the archives are notoriously hard to search):

Properties logProp = new Properties();
logProp.load(ActionServlet.getServletContext().getResourceAsStream("/WEB-INF/classes/log4j.properties"));
PropertyConfigurator.configure(logProp);

So you want getResourceAsStream instead seeing how the file is contained 
within a WAR file. :)

Regards,
-- 
Jason Bainbridge
http://jblinux.org

---------------------------------------------------------------------
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