OSGI下的Log4j(Eclipse RCP) [英] Log4j under OSGI (Eclipse RCP)
问题描述
我不会直接使用Log4j,但是我需要第三方插件来记录它。
我做了一个简单的JAVA项目,一切都很好,但是在PLUGIN开发没有任何作用。
我的Classpath中有log4j jar,甚至尝试使用符合OSGI的Log4j的Spring存储库,并将其包含在Dependencies中。没有任何工作。
我已经尝试了一些没有成功的方法:
http://swik.net/Eclipse/Planet+Eclipse/Raja+Kannappan:+Eclipse + RCP + - +转换+依赖关系+到+ OSGi +捆绑/ drqpf
并不能完全理解这一个:
http://www.eclipsezone.com/eclipse/forums/t99588.html
任何人都可以指向正确的方向?
谢谢。
您只需使用中的log4j.properties文件创建log4j片段包。
更新:要查找的东西:
- 标题名称应为:
Fragment-Host:log4j
。 - log4j.properties 应该在
src 文件夹中。 - 所有使用log4j的软件包应在
中import-Package
属性org.apache.log4j
/ li>
After many tests i concluded that the Log4j is not working under OSGI.
I do not use Log4j directly, but i need third party plugins to log with it.
I made a plain JAVA project and everything works great, but under PLUGIN development nothing works.
I have log4j jar in my Classpath and even tried a Spring repository OSGI compliant Log4j and included it under Dependencies. Nothing works.
I've tried this some approach with no success: http://swik.net/Eclipse/Planet+Eclipse/Raja+Kannappan:+Eclipse+RCP+-+Converting+Dependencies+to+OSGi+Bundles/drqpf
and could not fully understand this one: http://www.eclipsezone.com/eclipse/forums/t99588.html
Can anyone point me on the right direction?
Thanks.
You simply have to create log4j fragment bundle with the log4j.properties file inside.
UPDATE: Some things to look for:
- Header name should be:
Fragment-Host: log4j
. - log4j.properties should be in the src folder.
- All the bundles which use log4j should have
org.apache.log4j
in theirImport-Package
attribute
这篇关于OSGI下的Log4j(Eclipse RCP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!