0
我已將slf4j 1.6.1,logback-core-0.9.24.jar和logback-classic-0.9.24.jar添加到我的目標平臺,並將它們作爲依賴項添加到插件項目的MANIFEST文件中。Slf4j和日誌PDE項目中的logback?
在激活我做的:
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Activator implements BundleActivator {
private static final Logger logger = LoggerFactory.getLogger(Activator.class
.getName());
private static Activator defaultInstance;
public Activator() {
Activator.defaultInstance = this;
}
/*
* (non-Javadoc)
*
* @see
* org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
System.out.println(logger.isInfoEnabled());
System.out.println(logger.isDebugEnabled());
System.out.println(logger.isWarnEnabled());
System.out.println(logger.isErrorEnabled());
logger.info("llllladasdad");
}
}
}
,但它只是打印的所有情況,並沒有對信息呼叫假。如何在eclipse PDE項目中啓用logback?