From 11b635a3d964e550769b8243e24eeeeb4162a453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommy=20Tr=C3=B8en?= Date: Thu, 15 Dec 2022 17:20:40 +0100 Subject: [PATCH] fix(logging): bump logback to get newer version than 1.7.x of slf4j * fixes #388 by upgrading slf4j to 2.x * spring boot tests were failing due to Spring 2.7.x requiring slf4j 1.7.x * added spring.factories to prevent Spring from using its LoggingSystemLogback class causing a NoClassDefFoundError on class removed from slf4j 2.x * add sample docker-compose.yaml to easily test standalone mode --- build.gradle.kts | 2 +- docker-compose.yaml | 13 +++++++++++++ src/test/resources/META-INF/spring.factories | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 docker-compose.yaml create mode 100644 src/test/resources/META-INF/spring.factories diff --git a/build.gradle.kts b/build.gradle.kts index beba17b4..aafb812b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask val assertjVersion = "3.23.1" val kotlinLoggingVersion = "3.0.4" -val logbackVersion = "1.2.11" +val logbackVersion = "1.4.5" val nimbusSdkVersion = "10.4" val mockWebServerVersion = "4.10.0" val jacksonVersion = "2.14.1" diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000..2521a77a --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,13 @@ +version: "3.1" + +services: + mock-oauth2-server: + image: mock-oauth2-server:latest + ports: + - "8080:8080" + volumes: + - ./src/test/resources/config.json:/app/config.json + environment: + LOG_LEVEL: "debug" + SERVER_PORT: 8080 + JSON_CONFIG_PATH: /app/config.json diff --git a/src/test/resources/META-INF/spring.factories b/src/test/resources/META-INF/spring.factories new file mode 100644 index 00000000..40da61fa --- /dev/null +++ b/src/test/resources/META-INF/spring.factories @@ -0,0 +1,2 @@ +org.springframework.boot.logging.LoggingSystemFactory=\ +org.springframework.boot.logging.java.JavaLoggingSystem.Factory