Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.11.1
-
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.