Skip to content

Commit 432f64a

Browse files
committed
[SPARK-53783] Use log4j2 instead of log4j
### What changes were proposed in this pull request? This PR aims to use `log4j2` instead of `log4j` by - Use `log4j-slf4j2-impl` instead of `log4j-slf4j-impl` - Remove `log4j-1.2-api` ### Why are the changes needed? Apache Spark main repository has been using `log4j-slf4j2-impl` instead of `log4j-slf4j-impl` in order to use `Log4J2`. - apache/spark#37844 Apache Spark K8s Operator repository seems to use `log4j-slf4j2-impl` mistakenly at the initial implementation. - #8 ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #363 from dongjoon-hyun/SPARK-53783. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent cdf1abb commit 432f64a

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

build-tools/docs-utils/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ext {
2525
dependencies {
2626
implementation project(":spark-operator")
2727
implementation(libs.log4j.core)
28-
implementation(libs.log4j.slf4j.impl)
28+
implementation(libs.log4j.slf4j2.impl)
2929
compileOnly(libs.lombok)
3030
annotationProcessor(libs.lombok)
3131
}

gradle/libs.versions.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ crd-generator-apt = { group = "io.fabric8", name = "crd-generator-apt", version.
4848
lombok = { group = "org.projectlombok", name = "lombok", version.ref = "lombok" }
4949
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
5050
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
51-
log4j-slf4j-impl = { group = "org.apache.logging.log4j", name = "log4j-slf4j-impl", version.ref = "log4j" }
52-
log4j-api12 = { group = "org.apache.logging.log4j", name = "log4j-1.2-api", version.ref = "log4j" }
51+
log4j-slf4j2-impl = { group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version.ref = "log4j" }
5352
log4j-layout-template-json = { group = "org.apache.logging.log4j", name = "log4j-layout-template-json", version.ref = "log4j" }
5453
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
5554
operator-framework = { group = "io.javaoperatorsdk", name = "operator-framework", version.ref = "operator-sdk"}

spark-operator-api/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ dependencies {
2727
annotationProcessor(libs.lombok)
2828

2929
// logging
30-
implementation(libs.log4j.slf4j.impl) {
31-
exclude group: 'org.slf4j'
32-
}
30+
implementation(libs.log4j.slf4j2.impl)
3331
implementation(libs.log4j.core)
3432
implementation(libs.slf4j.api)
3533

spark-operator/build.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ dependencies {
3131
// logging
3232
implementation(libs.log4j.api)
3333
implementation(libs.log4j.core)
34-
implementation(libs.log4j.slf4j.impl) {
35-
exclude group: 'org.slf4j'
36-
}
37-
implementation(libs.log4j.api12)
34+
implementation(libs.log4j.slf4j2.impl)
3835
implementation(libs.log4j.layout.template.json)
3936
implementation(libs.slf4j.api)
4037

0 commit comments

Comments
 (0)