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

The sub module log4j-layout-template-json seems not properly configured to be deployed as a fragment host in OSGI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 2.17.1
    • None
    • JsonTemplateLayout
    • None
    • Tested on ServiceMix (under Docker) 7.0.1, but it should be the same in Karaf 4.x

      I also tried to add the original log4j2-api and log4j-core in the same config but the fragment never gets resolved.

    Description

      In the pom of the module we have:

      <plugin>
              <groupId>org.apache.felix</groupId>
              <artifactId>maven-bundle-plugin</artifactId>
              <configuration>
                <instructions>
                  <Fragment-Host>org.apache.logging.log4j.layout.template.json</Fragment-Host>
                  <Export-Package>*</Export-Package>
                </instructions>
              </configuration>
            </plugin>
      

      The Fragment host seems to refer to itself.

      When I tried to deploy this jar as a bundle with this in my startup.properties file:

      mvn\:org.apache.logging.log4j/log4j-layout-template-json/2.17.1 = 5
      mvn\:org.ops4j.pax.logging/pax-logging-log4j2-extra/1.11.13 = 6
      mvn\:org.ops4j.pax.logging/pax-logging-api/1.11.13 = 8
      mvn\:org.ops4j.pax.logging/pax-logging-log4j2/1.11.13 = 8
      

      And copying the lib in the "system" folder of karaf (I tried with ServiceMix 7.0.1).

      The bundle stays in status "Installed" and never resolves as the Fragment-Host refers to itself.

      I am not sure what values should be set in this as I am using Pax Logging, but for sure the Host does not seems correct to me (otherwise I would have created a PR).

      Attachments

        Activity

          People

            vy Volkan Yazici
            ruffp ruffp
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: