Wednesday, July 05, 2006

I get "log4j:WARN No appenders could be found for logger" message

While using log4j in your application, sometimes you might encounter the following message:

log4j:WARN No appenders could be found for logger(somePackageName.someClassName).
log4j:WARN Please initialize the log4j system properly.


The reason why you see this message is that your log4j configuration file(i.e. log4j.xml or log4j.properties) is NOT found in the classpath. Placing the log4j configuration file in the applications classpath should solve the issue. If you want to find out how log4j tries to configure itself, have a look at my earlier post :

Know how log4j tries to configure itself



2 comments:

satyadas said...

This worked for me too..thanks

rehan said...

How to load log4j.xml if it is not present at its default location, without changing its location(i.e without moving and placing in the applications classpath)?