log4j.xml path problem
I am trying to get log4j working开发者_Python百科 using xml configuration. I have log4j.xml added to classpath but while running I am getting :
log4j:WARN No appenders could be found for logger (test.DateFormatter). log4j:WARN Please initialize the log4j system properly.
If I place a log4j.properties instead it seems to pick up the configuration. Any ideas
It's good to have a log4j.xml in the classpath but it also has to provide the correct configuration. So maybe you post the content of your log4j.xml file so we can help you (maybe typo in logger configuration?).
You should also have a look at the log4j manual. The section "Default Initialization Procedure" describes how log4j will try to find the initialization file.
精彩评论