I am using Struts 1.1 on Weblogic Aplication Server.
I am logging messages using log4j.But I am getting the foloeing error when I have started the server.
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
I would be happy if any one of you could help me in solving the problem.
Thanks & Regards,
Raghavendra.
Discussions
Web tier: servlets, JSP, Web frameworks: Problem in logging messages using struts on weblogic
-
Problem in logging messages using struts on weblogic (10 messages)
- Posted by: Raghavendra Swamy
- Posted on: February 08 2005 00:37 EST
Threaded Messages (10)
- log4j by Ash H on February 08 2005 09:25 EST
- log4j by Raghavendra Swamy on February 09 2005 02:31 EST
-
None by Ash H on February 09 2005 11:42 EST
-
Not able to solve by Raghavendra Swamy on February 14 2005 06:29 EST
-
Not able to solve by Andy Deighton on February 14 2005 07:51 EST
- not solved by Raghavendra Swamy on February 21 2005 12:46 EST
-
Not able to solve by Andy Deighton on February 14 2005 07:51 EST
-
Not able to solve by Raghavendra Swamy on February 14 2005 06:29 EST
-
None by Ash H on February 09 2005 11:42 EST
- log4j by Raghavendra Swamy on February 09 2005 02:31 EST
- Problem in logging messages using struts on weblogic by David Matheson on February 22 2005 13:59 EST
- Problem solved by Raghavendra Swamy on February 23 2005 09:57 EST
- Problem in logging messages using struts on weblogic by Vijay Kumar on September 19 2005 05:34 EDT
- Re: Problem in logging messages using struts on weblogic by chaminda hettigoda on August 18 2006 06:38 EDT
-
log4j[ Go to top ]
- Posted by: Ash H
- Posted on: February 08 2005 09:25 EST
- in response to Raghavendra Swamy
Hi,
Looks like Log4J failed to locate the log4j.properties file in the class path, check if you have it in your classpath.
Ash -
log4j[ Go to top ]
- Posted by: Raghavendra Swamy
- Posted on: February 09 2005 02:31 EST
- in response to Ash H
I have included massage-resources tag in struts-config.xml as follows:
<message-resources parameter="com.raghu.struts.log4j>
and placed the log4j.properties file in
WEB-INF > classes > com > raghu > struts folder.
Note:- The above gives the directory structure.
Can you please say me how to set classpath. I am developing in Eclipse IDE without using eclipse easy struts plugins.
Thanks for your response. -
None[ Go to top ]
- Posted by: Ash H
- Posted on: February 09 2005 11:42 EST
- in response to Raghavendra Swamy
Hi,
You can either set the folder where your properties file is in the server classpath it is not recommended if you have EJB and WEB classes both referring to it,but an easy wayout.
Place log4j.jar in web-INF/lib or directly in server classpath.
Ash -
Not able to solve[ Go to top ]
- Posted by: Raghavendra Swamy
- Posted on: February 14 2005 06:29 EST
- in response to Ash H
I was not able to solve the problem even by this method. -
Not able to solve[ Go to top ]
- Posted by: Andy Deighton
- Posted on: February 14 2005 07:51 EST
- in response to Raghavendra Swamy
Make sure your Eclipse project's classpath can "see" the log4j jar file (in your Project's properties, go to the "Java Build Path" item and click on the Libraries tab). This will help avoid development-time errors.
Make sure you have a log4j.properties file somewhere that is accessible by your application at runtime (WEB-INF/classes is an OK place to put it).
Lastly, ensure that when you build your app, the log4j jar file is in the WEB-INF/lib directory of your application.
Shouldn't need anything else. No need to tell Struts about it.
Andy -
not solved[ Go to top ]
- Posted by: Raghavendra Swamy
- Posted on: February 21 2005 00:46 EST
- in response to Andy Deighton
I am able to run the application, but the following error is still continuing in the server console window.
log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
log4j:WARN Please initialize the log4j system properly.
What should be the content of log4j.properties file.
Can any of you help me.
Thanks & Regards,
Raghavendra -
Problem in logging messages using struts on weblogic[ Go to top ]
- Posted by: David Matheson
- Posted on: February 22 2005 13:59 EST
- in response to Raghavendra Swamy
I had the same problem as you until I realized that my log4j.xml file only included the packages for my application:
<logger name="com.foo">
<level value="debug"/>
<appender-ref ref="DEBUG"/>
<appender-ref ref="INFO"/>
<appender-ref ref="WARN"/>
<appender-ref ref="ERROR"/>
<appender-ref ref="FATAL"/>
</logger>
I just added another logger entry:
<logger name="org.apache">
<level value="debug"/>
<appender-ref ref="DEBUG"/>
<appender-ref ref="INFO"/>
<appender-ref ref="WARN"/>
<appender-ref ref="ERROR"/>
<appender-ref ref="FATAL"/>
</logger>
And everything was fine. This does include all Apache debugging messages in your logs. If you don't like this, you can easily specify different appenders for those messages from Apache. -
Problem solved[ Go to top ]
- Posted by: Raghavendra Swamy
- Posted on: February 23 2005 09:57 EST
- in response to David Matheson
Thanks David,
My Problem is solved by following your method.
Thanks a lot dear friend.
Regards,
Raghavendra -
Problem in logging messages using struts on weblogic[ Go to top ]
- Posted by: Vijay Kumar
- Posted on: September 19 2005 05:34 EDT
- in response to David Matheson
Hi, could you give the equavalent to this if I am using properties file (resource bundle) to configure instead of XML.
I tried
log4j.org.apache=DEBUG, stdout
Its not working, I am still getting the same warning
This is urgent :-) thanks
Vijay Kumar -
Re: Problem in logging messages using struts on weblogic[ Go to top ]
- Posted by: chaminda hettigoda
- Posted on: August 18 2006 06:38 EDT
- in response to Vijay Kumar
you can eliminate this by using a init servlet. public void init() throws ServletException { // Call the super class initialization try { //XMA base configuration DOMConfigurator.configure("c:/myapp/log4j.xml"); //property file base configuration PropertyConfigurator.configure(("c:/myapp/log4j.properties"); } catch (ServletException e) { e.printStackTrace(); // m_cLog.error(e); throw(e); } }