[slf4j-user] OSGi meta data in 1.6
David Savage
david.savage at paremus.com
Wed Jun 30 13:56:58 CEST 2010
Hi,
I'm working on integrating slf4j 1.6 in an osgi environment and have
hit a stumbling block using the log4j-over-slf4j legacy support.
The bundle exports the org.apache.log4j package using the default
version (0.0.0) this causes problems when client code tries to use
these packages if they declare an explicit import version range - in
our case the imports are:
Import-Package: org.apache.log4j;version=[1.2.14,1.3)
0.0.0 is not in the range 1.2.14->1.3
In my environment I've rebuilt the log4j-over-slf4j bundle with the
following manifest which fixes the problem:
$ cat log4j-over-slf4j/src/main/resources/META-INF/MANIFEST.MF
Implementation-Title: log4j-over-slf4j
Bundle-SymbolicName: log4j.over.slf4j
Bundle-Name: log4j-over-slf4j
Bundle-Vendor: SLF4J.ORG
Export-Package: org.apache.log4j;version=1.2.14
Import-Package: org.slf4j, org.slf4j.helpers, org.slf4j.spi
However I'm just taking a wild guess that 1.2.14 is the version of the
log4j api that this bundle provides. Is there any chance that this
meta data (and other related meta data) could be added to the adapter
bundles to make life easier for us OSGi folk? ;)
Regards,
Dave
More information about the slf4j-user
mailing list