From 290e1fe14460d91e4703e55ac5f05dbe7b4505f7 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 12 Oct 2022 21:53:53 +0200 Subject: fix: Add log4j-core dependency This change adds the log4j-core dependency to various modules of OpenDC using log4j2, to ensure logging keeps working. The upgrade to SLF4J 2.0 broke the Log4j2 functionality, since the log4j-core artifact is not automatically shipped with the SLF4J implementation. --- gradle/libs.versions.toml | 1 + opendc-compute/opendc-compute-service/build.gradle.kts | 1 + opendc-experiments/opendc-experiments-capelin/build.gradle.kts | 1 + opendc-faas/opendc-faas-service/build.gradle.kts | 1 + opendc-trace/opendc-trace-tools/build.gradle.kts | 1 + opendc-web/opendc-web-runner/build.gradle.kts | 3 ++- 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ac1ce5e9..824001c3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -36,6 +36,7 @@ kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", # Logging kotlin-logging = { module = "io.github.microutils:kotlin-logging", version.ref = "kotlin-logging" } slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } +log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } log4j-slf4j = { module = "org.apache.logging.log4j:log4j-slf4j2-impl", version.ref = "log4j" } sentry-log4j2 = { module = "io.sentry:sentry-log4j2", version.ref = "sentry" } diff --git a/opendc-compute/opendc-compute-service/build.gradle.kts b/opendc-compute/opendc-compute-service/build.gradle.kts index fd15b6e7..1a73201e 100644 --- a/opendc-compute/opendc-compute-service/build.gradle.kts +++ b/opendc-compute/opendc-compute-service/build.gradle.kts @@ -33,5 +33,6 @@ dependencies { implementation(libs.kotlin.logging) testImplementation(projects.opendcSimulator.opendcSimulatorCore) + testRuntimeOnly(libs.log4j.core) testRuntimeOnly(libs.log4j.slf4j) } diff --git a/opendc-experiments/opendc-experiments-capelin/build.gradle.kts b/opendc-experiments/opendc-experiments-capelin/build.gradle.kts index e19784ba..da45adde 100644 --- a/opendc-experiments/opendc-experiments-capelin/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-capelin/build.gradle.kts @@ -44,6 +44,7 @@ dependencies { implementation(libs.jackson.dataformat.csv) runtimeOnly(projects.opendcTrace.opendcTraceOpendc) + runtimeOnly(libs.log4j.core) runtimeOnly(libs.log4j.slf4j) } diff --git a/opendc-faas/opendc-faas-service/build.gradle.kts b/opendc-faas/opendc-faas-service/build.gradle.kts index 34f5b7ea..8b371998 100644 --- a/opendc-faas/opendc-faas-service/build.gradle.kts +++ b/opendc-faas/opendc-faas-service/build.gradle.kts @@ -34,5 +34,6 @@ dependencies { implementation(libs.kotlin.logging) testImplementation(projects.opendcSimulator.opendcSimulatorCore) + testRuntimeOnly(libs.log4j.core) testRuntimeOnly(libs.log4j.slf4j) } diff --git a/opendc-trace/opendc-trace-tools/build.gradle.kts b/opendc-trace/opendc-trace-tools/build.gradle.kts index e98fb932..db11059b 100644 --- a/opendc-trace/opendc-trace-tools/build.gradle.kts +++ b/opendc-trace/opendc-trace-tools/build.gradle.kts @@ -46,5 +46,6 @@ dependencies { runtimeOnly(projects.opendcTrace.opendcTraceSwf) runtimeOnly(projects.opendcTrace.opendcTraceWfformat) runtimeOnly(projects.opendcTrace.opendcTraceWtf) + runtimeOnly(libs.log4j.core) runtimeOnly(libs.log4j.slf4j) } diff --git a/opendc-web/opendc-web-runner/build.gradle.kts b/opendc-web/opendc-web-runner/build.gradle.kts index 2679a97f..531a9631 100644 --- a/opendc-web/opendc-web-runner/build.gradle.kts +++ b/opendc-web/opendc-web-runner/build.gradle.kts @@ -58,10 +58,11 @@ dependencies { runtimeOnly(projects.opendcTrace.opendcTraceBitbrains) cliImplementation(libs.clikt) - cliImplementation(libs.sentry.log4j2) cliRuntimeOnly(projects.opendcTrace.opendcTraceOpendc) + cliRuntimeOnly(libs.log4j.core) cliRuntimeOnly(libs.log4j.slf4j) + cliRuntimeOnly(libs.sentry.log4j2) } val createCli by tasks.creating(CreateStartScripts::class) { -- cgit v1.2.3