From c5d385bef9a5d3dc069c47de0cd7913a44895fa8 Mon Sep 17 00:00:00 2001 From: Leonardo macOS Date: Thu, 11 Jul 2024 19:38:43 +0200 Subject: [PATCH] decided to use logback with slf4j, seems stable and good. It works now with no warnings from terminal, whereas from IDE we keep (after uncountable hours) getting SLF4J: No SLF4J providers were found. Log is correctly written to file but also ends up in console, which has to be fixed --- pom.xml | 36 +++++++++++------------------- src/main/resources/log4j2.xml | 13 ----------- src/main/resources/logback.xml | 40 ++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 36 deletions(-) delete mode 100644 src/main/resources/log4j2.xml create mode 100644 src/main/resources/logback.xml diff --git a/pom.xml b/pom.xml index 3fbacba..c5d1060 100644 --- a/pom.xml +++ b/pom.xml @@ -163,20 +163,11 @@ 5.9.2 test + - org.slf4j - slf4j-api - 2.0.13 - - - org.apache.logging.log4j - log4j-core - 2.23.1 - - - org.apache.logging.log4j - log4j-slf4j-impl - 2.23.1 + ch.qos.logback + logback-classic + 1.5.6 @@ -237,17 +228,10 @@ junit-jupiter test + - org.slf4j - slf4j-api - - - org.apache.logging.log4j - log4j-core - - - org.apache.logging.log4j - log4j-slf4j-impl + ch.qos.logback + logback-classic @@ -370,6 +354,12 @@ false + + + org.apache.maven.plugins + maven-dependency-plugin + 3.7.1 + diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml deleted file mode 100644 index 77ca892..0000000 --- a/src/main/resources/log4j2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml new file mode 100644 index 0000000..871a7c1 --- /dev/null +++ b/src/main/resources/logback.xml @@ -0,0 +1,40 @@ + + + # Console appender + + + # Rolling File appender + + + + # Pattern of log message for console appender + %d{yyyy-MM-dd HH:mm:ss} %-5p %m%n + + ${LOG_FILE}.log + + + ${LOG_FILE}.%d{yyyy-MM-dd}.gz + + + 30 + 1GB + + + %-4relative [%thread] %-5level %logger{35} - %msg%n + + + + # Override log level for specified package + + + + + + + +