[ https://issues.apache.org/jira/browse/LOG4J2-3601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17606710#comment-17606710 ]
Christopher Tubbs edited comment on LOG4J2-3601 at 9/19/22 6:37 PM: -------------------------------------------------------------------- This bit us when we tried to update to slf4j 2.0.1 with log4j-slf4j2-impl in Apache Accumulo at https://github.com/apache/accumulo/pull/2942 See this partial diff comparing log4j-slf4j-impl and the new log4j-slf4j2-impl. Their dependency on log4j-core should be the same: runtime. {code} --- ~/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.19.0/log4j-slf4j-impl-2.19.0.pom 2022-09-19 14:20:09.033906470 -0400 +++ ~/.m2/repository/org/apache/logging/log4j/log4j-slf4j2-impl/2.19.0/log4j-slf4j2-impl-2.19.0.pom 2022-09-18 20:50:31.103647811 -0400 @@ -23,15 +23,13 @@ <version>2.19.0</version> </parent> - <artifactId>log4j-slf4j-impl</artifactId> + <artifactId>log4j-slf4j2-impl</artifactId> <packaging>jar</packaging> - <name>Apache Log4j SLF4J Binding</name> - <description>The Apache Log4j SLF4J API binding to Log4j 2 Core</description> + <name>Apache Log4j SLF4J 2.0 Binding</name> + <description>The Apache Log4j SLF4J 2.0 API binding to Log4j 2 Core</description> <properties> <log4jParentDir>${basedir}/..</log4jParentDir> <docLabel>SLF4J Documentation</docLabel> - <projectDir>/slf4j-impl</projectDir> - <!-- Do not upgrade the SLF4J version. 1.7.26 broke backward compatibility. Users can update the version if - they do not require support for SLF4J's EventData --> - <slf4j.version>1.7.25</slf4j.version> + <projectDir>/slf4j2-impl</projectDir> + <slf4j.version>2.0.0</slf4j.version> <module.name>org.apache.logging.log4j.slf4j</module.name> <maven.doap.skip>true</maven.doap.skip> @@ -56,5 +54,5 @@ <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <scope>runtime</scope> + <scope>test</scope> </dependency> <dependency> {code} was (Author: ctubbsii): This bit us when we tried to update to slf4j 2.0.1 with log4j-slf4j2-impl. See this partial diff comparing log4j-slf4j-impl and the new log4j-slf4j2-impl. Their dependency on log4j-core should be the same: runtime. {code} --- ~/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.19.0/log4j-slf4j-impl-2.19.0.pom 2022-09-19 14:20:09.033906470 -0400 +++ ~/.m2/repository/org/apache/logging/log4j/log4j-slf4j2-impl/2.19.0/log4j-slf4j2-impl-2.19.0.pom 2022-09-18 20:50:31.103647811 -0400 @@ -23,15 +23,13 @@ <version>2.19.0</version> </parent> - <artifactId>log4j-slf4j-impl</artifactId> + <artifactId>log4j-slf4j2-impl</artifactId> <packaging>jar</packaging> - <name>Apache Log4j SLF4J Binding</name> - <description>The Apache Log4j SLF4J API binding to Log4j 2 Core</description> + <name>Apache Log4j SLF4J 2.0 Binding</name> + <description>The Apache Log4j SLF4J 2.0 API binding to Log4j 2 Core</description> <properties> <log4jParentDir>${basedir}/..</log4jParentDir> <docLabel>SLF4J Documentation</docLabel> - <projectDir>/slf4j-impl</projectDir> - <!-- Do not upgrade the SLF4J version. 1.7.26 broke backward compatibility. Users can update the version if - they do not require support for SLF4J's EventData --> - <slf4j.version>1.7.25</slf4j.version> + <projectDir>/slf4j2-impl</projectDir> + <slf4j.version>2.0.0</slf4j.version> <module.name>org.apache.logging.log4j.slf4j</module.name> <maven.doap.skip>true</maven.doap.skip> @@ -56,5 +54,5 @@ <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> - <scope>runtime</scope> + <scope>test</scope> </dependency> <dependency> {code} > log4j-slf4j2: change of dependency scope for log4j-core > ------------------------------------------------------- > > Key: LOG4J2-3601 > URL: https://issues.apache.org/jira/browse/LOG4J2-3601 > Project: Log4j 2 > Issue Type: Improvement > Components: SLF4J Bridge > Reporter: Andy Seaborne > Priority: Major > Fix For: 2.19.0 > > > The artifact {{log4j-slf4j-impl}} has a scope=runtime dependency on > log4j-core. {{log4j-slf4j18-impl}} similarly had scope=runtime. > The artifact {{log4j-slf4j2-impl}} has a scope=test dependency on log4j-core. > This changed as part of [commit > 8f63620875|https://github.com/apache/logging-log4j2/pull/1024/files#diff-d3ba9956a9f81420d0be3d69477a05b505746272d548ab17404aa47f3e5946b0] > although it seems to be unrelated. > It makes switching over more of a bump. Previously just depending on > {{log4j-slf4j-impl}} was enough. > Please switch back to a scope=runtime dependency for {{log4j-slf4j2-impl}}. > Example: we (Apache Jena) use slf4j in the main code base, and select log4j > when it needed for binaries tests so we have multiple places where the > dependency happens. We can change - but this may be a user experience for > others as well. > {noformat} > [INFO] +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.18.0:compile > [INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.18.0:compile > [INFO] | \- org.apache.logging.log4j:log4j-core:jar:2.18.0:runtime > {noformat} > {noformat} > [INFO] +- org.apache.logging.log4j:log4j-slf4j2-impl:jar:2.19.0:compile > [INFO] | \- org.apache.logging.log4j:log4j-api:jar:2.19.0:compile > {noformat} > -- This message was sent by Atlassian Jira (v8.20.10#820010)