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?
Add the following as the first code:
In my case, the error was the flag "additivity". If it's "false" for you root project package, then the child packages will not have an appender and you will see the "appender not found" error.
Another reason this may happen (in RCP4) is that you are using multiple logging frameworks in your target file. As an example, this will occur if you use a combination of slf4j, log4j and ch.qos.logback.slf4j in your target files content tab.
In java eclipse copy your conf_ref to conf folder.
The solution on this site worked for me https://crunchify.com/java-how-to-configure-log4j-logger-property-correctly/. I now see no warnings at all from log4j
I put this in a log4j.properties file that I put in src/main/resources
As explained earlier there are 2 approaches
First one is to just add this line to your main method:
Second approach is to add this standard log4j.properties file to your classpath:
While taking second approach you need to make sure you initialize the file properly, Eg.
Make sure you create required folder to store log files.