Skip to content

Commit b6f78bc

Browse files
committed
Replace log4j-slf4j-impl with slf4j-api in spring-kafka-test
Change spring-kafka-test to depend on slf4j-api instead of log4j-slf4j-impl. This removes the forced Log4j binding from the API surface, allowing consumers to choose their own SLF4J implementation while still providing the compile-time dependency required by Kafka's Utils class. The slf4j-api dependency is needed because Kafka 4.x client libraries use SLF4J for logging (e.g., Utils.closeQuietly() references org.slf4j.Logger). Tests continue to use Log4j via the testRuntimeOnly dependency configured globally. Signed-off-by: Soby Chacko <[email protected]>
1 parent 67687a1 commit b6f78bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ ext {
6868
micrometerTracingVersion = '1.6.0-RC1'
6969
mockitoVersion = '5.19.0'
7070
reactorVersion = '2025.0.0-RC1'
71+
slf4jVersion = '2.0.17'
7172
springBootVersion = '3.5.0' // docs module
7273
springDataVersion = '2025.1.0-RC1'
7374
springVersion = '7.0.0-RC1'
@@ -314,7 +315,7 @@ project ('spring-kafka-test') {
314315
description = 'Spring Kafka Test Support'
315316

316317
dependencies {
317-
api "org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion"
318+
api "org.slf4j:slf4j-api:$slf4jVersion"
318319
api 'org.springframework:spring-context'
319320
api 'org.springframework:spring-test'
320321

0 commit comments

Comments
 (0)