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

Missing dependency to log4j-slf4j18-impl in log4j-bom

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.11.1
    • 2.11.2
    • SLF4J Bridge
    • None

    Description

      According to https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/index.html there are two SLF4J to Log4j adapters provided since release 2.11.1:

      • log4j-slf4j-impl for SLF4J 1.7.x releases or older
      • log4j-slf4j18-impl for SLF4J 1.8.x releases or newer

      When I use the following snippet in my (corporate parent) pom.xml

      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-bom</artifactId>
            <version>2.11.1</version>
            <scope>import</scope>
            <type>pom</type>
          </dependency>
        </dependencies>
      </dependencyManagement>
      

      I can omit the version numbers in my pom.xml for the Log4J components I'm using:

      (...)
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
      </dependency>
      
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
      </dependency>
      
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-jul</artifactId>
      </dependency>
      (...)
      

      This only works for the artifact log4j-slf4j-impl, but NOT for log4j-slf4j18-impl which isn't contained / managed in the BOM.

      Attachments

        Activity

          People

            Unassigned Unassigned
            t_heit Thorsten Heit
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 10m
                10m