Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3545

Log4J-JCL should have the same OSGI configuration as Log4j-SLF4J18

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.2
    • 2.19.0
    • JCL Bridge
    • 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:

      https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-slf4j18-impl/2.17.2/log4j-slf4j18-impl-2.17.2.jar

       

      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

       

       

      Attachments

        Activity

          People

            pkarwasz Piotr Karwasz
            jcompanger@gmail.com Johan Compagner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: