運(yùn)行控制臺(tái)打印:(只在控制臺(tái)上,不在.log文件中)
log4j:WARN No appenders could be found for logger (myrcp.OpenViewAction).
log4j:WARN Please initialize the log4j system properly.
這是因?yàn)闆]有添加Log4j的配置信息。
在啟動(dòng)RCP的插件中的start方法里:
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
Properties prop = new Properties();
try {
prop.load(Activator.class.getResourceAsStream("log4j.properties")); //$NON-NLS-1$
} catch (IOException e) {
// e.printStackTrace();
}
PropertyConfigurator.configure(prop);
}
在myrcp.Activator同級(jí)目錄下添加log4j.properties:
posted on 2012-04-28 17:56
Ke 閱讀(972)
評(píng)論(0) 編輯 收藏 所屬分類:
eclipse RCP 、
log4j