Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.17.2
-
None
Description
if you look at the manifest in this jar:
https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-jcl/2.17.2/log4j-jcl-2.17.2.jar
compared to the one that is in here:
then slf4j has the right OSGI manifest entries to work correctly with the ServiceLoader
SLF4j has:
Require-Capability: osgi.extender;filter:="(osgi.extender=osgi.service
loader.registrar)",osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Provide-Capability: osgi.serviceloader;osgi.serviceloader="org.slf4j.s
pi.SLF4JServiceProvider"
JCL has:
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
this should become to fully support it in an OSGi environment:
Require-Capability: osgi.extender;filter:="(osgi.extender=osgi.servicelo
ader.registrar)",osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Provide-Capability: osgi.serviceloader;osgi.serviceloader="org.apache.commons.logging.LogFactory"
to follow the spec: 133 Service Loader Mediator Specification - OSGi Enterprise 7