[
https://issues.apache.org/jira/browse/LOG4J2-2037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16158116#comment-16158116
]
Matt Sicker commented on LOG4J2-2037:
-------------------------------------
While I'm not sure which version Maven (or Gradle) would end up choosing, by
using log4j-bom combined with log4j-slf4j-impl, that brings in the latest
version of slf4j-api that was tested against that release (usually the latest).
However, I could see the possibility that if you import multiple boms (e.g., a
spring-boot or spring-platform one), the earlier or later ones may override the
default version.
> Include SLF4J in log4j-bom
> --------------------------
>
> Key: LOG4J2-2037
> URL: https://issues.apache.org/jira/browse/LOG4J2-2037
> Project: Log4j 2
> Issue Type: Improvement
> Affects Versions: 2.9.0
> Environment: Maven
> Reporter: Arend v. Reinersdorff
>
> 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:
> {code:xml}
> <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>
> {code}
>
> 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 |
> http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.springframework.boot%22%20AND%20a%3A%22spring-boot-dependencies%22]
> BOM which conveniently specifies many optional Spring Boot dependencies.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)