Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Enable Log4j in Struts

843836Jul 15 2004 — edited May 17 2008
Hi,

I have a struts application and I need to implement a logger for it. I would like to use Log4j but am having problems initializing it.

Because I am using struts, I do no have access to the Action servlet and so cannot place the intiializing code in the servlets init() method.

Is there a way of using the struts-confix.xml file to enable Log4j logging ?

Basically I need the application to load up the log4j.properties file using

PropertyConfiguratior.configure("log4j.properties");

But how do I do this in Struts ??

thanks
Paul

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 14 2008
Added on Jul 15 2004
4 comments
336 views