views:

60

answers:

1

I need to use log4j in my application, but I don't know how I can get properties loaded. Deafult properties files says that I should put log4j.properties to /WEB-INF/classes/ folder, but in eclipse I cannot see that folder and I cannot create it, because it already exists. And I cannot add any files to that folder either.

Here is error that I get:

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

So how can I get web application to load log4j properties?

A: 

Put the log4j.properties file into a source directory of your project, e.g. /src. Eclipse will copy it into your target build directory.

I recomend using SLF4J with Log4J, and the SpringSource Tool Suite (STS) for your project.

danielgeske