I created an Eclipse PDE project and added log4j as a dependency using the slf4j-api and slf4j.log4j12 packages. In the class I created a registrar:
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MyTest {
private static final Logger logger = LoggerFactory.getLogger(MyTest.class
.getName());
public void tt() {
logger.info("log-test");
}
}
but when I start the PDE project using the OSGI startup configuration, I get warnings:
log4j:WARN No appenders could be found for logger (loggin_test.MyTest).
log4j:WARN Please initialize the log4j system properly.
based on this information:
http://jaikiran.wordpress.com/2006/07/05/i-get-log4jwarn-no-appenders-could-be-found-for-logger-message-2/
I need to put log4j.properties in the path of the PDE class. I tried putting it in the root of the PDE project and adding:
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
log4j.properties
in the build.properties panel. But I still get the same warning. Where can I put the log4j.properties file in a PDE project?
EDIT: I also tried adding it to the / src folder, but that won't help.