25 March 2011

how to add log4j.properties to classpath in Eclipse (For java aplication)?

Fancy log4j ?
 Good,because it is cool stuff....
 However ...but when you get started, then everything looks simply and go smoothly until you trying to run application , then  ... you see.

log4j:WARN No appenders could be found for logger (org.my.amazing.application).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

 No good, then question is Set I everything correctly ?

Below you have receipe how to setup log4j correctly to be DAMN sure, that it will work.

1) add log4j.jar to lib (or any place where you store your libraries

2) and add log4j.properties to src folder in Java Resources

and btw. make sure that  configure log4j.properties correctly.

1 comment:

  1. thank you...looked thru many posts and this is the first one that fixed it for me simply!

    ReplyDelete