tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phillip Qin <Phillip....@shareowner.com>
Subject RE: Logging via log4j and war file question
Date Mon, 23 Jun 2003 16:10:22 GMT
You don't need this line of code at all! Log4J automatically searches for
your log4j.properties.

But, as general practice, try avoiding getRealPath... to get java.io.File,
use getServletContext().getResourceAsStream instead.

-----Original Message-----
From: Jim Lynch [mailto:jwl@sgi.com] 
Sent: 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("/")+"/WEB-IN
F/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

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