log4j No appenders could be found for logger. Please initialize the log4j system properly.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Brian_Parrella
Posted On:   Friday, June 20, 2008 12:35 PM

Getting an error message when I try to run a script:




log4j:WARN No appenders could be found for logger (org.apache.commons.httpclient.HttpClient).

log4j:WARN Please initialize the log4j system properly.





No idea what to do. I see people getting this error all over when I search Google, but no solutions.





Looked all over for a log4j.properties file but couldn't find one. Log4j was installed by YaST2 automatically at OS setup.

Re: log4j No appenders could be found for logger. Please initialize the log4j system properly.

Posted By:   Anonymous  
Posted On:   Tuesday, July 1, 2008 12:24 PM

Hello,
I guess you are trying to run a console application like Junit or may be something similar, and trying to debug using org.apache.log4j.Logger

Here the problem is, the application cannot find the log4j specific configuration files, so doesnt know which appender to use.

So if you want to get rid of this message and use a basic appender, in the initialization part of your code, add the following:

org.apache.log4j.BasicConfigurator.configure();

Cheers
Aneesh

Re: log4j No appenders could be found for logger. Please initialize the log4j system properly.

Posted By:   Stephen_McConnell  
Posted On:   Saturday, June 21, 2008 07:23 PM

Although Log4J was installed by YaST2, each project needs a log4j properties file. Look through this FAQ on Log4j. It has links to some discussions on how to set up the log4j properties files.


Stephen McConnell

About | Sitemap | Contact