運行控制臺打印:(只在控制臺上,不在.log文件中)
log4j:WARN No appenders could be found for logger (myrcp.OpenViewAction).
log4j:WARN Please initialize the log4j system properly.
這是因為沒有添加Log4j的配置信息。
在啟動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同級目錄下添加log4j.properties:
posted on 2012-04-28 17:56
Ke 閱讀(972)
評論(0) 編輯 收藏 所屬分類:
eclipse RCP 、
log4j