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

Include SLF4J in log4j-bom

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • 2.9.0
    • None
    • None
    • None
    • Maven

    Description

      Currently log4j-bom only includes Log4j 2 dependencies. It would be nice log4j-bom would also include an slf4j-api dependency (and maybe other optional dependencies).

      Currently when using Log4j 2 as a backend for SLF4J the Maven dependency management would look like this:

          <dependencyManagement>
              <dependencies>
                  <dependency>
                      <groupId>org.slf4j</groupId>
                      <artifactId>slf4j-api</artifactId>
                      <version>1.7.25</version> <!-- Must match dependency version of log4j-bom -->
                  </dependency>
                  <dependency>
                      <groupId>org.apache.logging.log4j</groupId>
                      <artifactId>log4j-bom</artifactId>
                      <version>2.9.0</version>
                      <type>pom</type>
                      <scope>import</scope>
                  </dependency>
              </dependencies>
          </dependencyManagement>
      

      If log4j-bom would specify a dependency for slf4j-api:

      • Dependency management entry for slf4j-api would no longer be needed
      • Keeping the dependency versions of Log4j 2 and SLF4J in sync would much easier. When the dependency version of log4j-bom is increased, it would automatically set the dependency version of slf4j-api.

      As an example see spring-boot-dependencies BOM which conveniently specifies many optional Spring Boot dependencies.

      Attachments

        Activity

          People

            Unassigned Unassigned
            arendvr.com Arend v. Reinersdorff
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: