I have put log4j to my buildpath, but I get the following message when I run my application:
log4j:WARN No appenders could be found for logger (dao.hsqlmanager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
What do these warnings mean? Whats the appender here?
Maybe add the relevent project contains log4j in java build path, I add mahout_h2o into it when I met this problem in a mahout project using eclipse, it works!
I had this problem too. I just forgot to mark the resources directory in IntelliJ IDEA
Make sure the properties file has properly set. And again, it seems like that the compiler cannot find the properties file, you can set as follow at the pom (only when you use maven project).
I think you should understand where the log4j jar file or the Java code looks for the log4j configuration files.
src/main/resources/log4j.properties
is Eclipse path. Place them in a proper location so that you don't have to hard code the absolute path in code.Read my article and sample solution for that http://askyourquestions.info/2016/03/27/how-to-see-where-the-log-is-logger-in-slf4j/
I get the same error. Here the problem which leads to this error message:
I create some objects which use the Logger before I configure the log4j:
Solution: Configure the log4j at the beginning in the main method:
Most of the answers here suggested that
log4j.properties
file be placed in the right location(for maven project, it should be located insrc/main/resources
)But for me, the problem is that my
log4j.properties
is not correctly configured. Here's a sample that works for me, you can try it out first.