Skip to content

Commit 1edbfb4

Browse files
committed
fix: update SLF4J and Log4j dependencies for compatibility
1 parent 55861aa commit 1edbfb4

File tree

4 files changed

+35
-38
lines changed

4 files changed

+35
-38
lines changed

fesod-examples/fesod-sheet-examples/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@
4343
<groupId>org.springframework.boot</groupId>
4444
<artifactId>spring-boot-starter-web</artifactId>
4545
<scope>test</scope>
46+
<exclusions>
47+
<exclusion>
48+
<groupId>org.springframework.boot</groupId>
49+
<artifactId>spring-boot-starter-logging</artifactId>
50+
</exclusion>
51+
<exclusion>
52+
<groupId>org.slf4j</groupId>
53+
<artifactId>slf4j-api</artifactId>
54+
</exclusion>
55+
</exclusions>
56+
</dependency>
57+
<!-- Use Logback 1.2.x with SLF4J 1.7.x for Spring Boot 2.7.x compatibility -->
58+
<dependency>
59+
<groupId>ch.qos.logback</groupId>
60+
<artifactId>logback-classic</artifactId>
61+
<version>1.2.13</version>
62+
<scope>test</scope>
4663
</dependency>
4764
</dependencies>
4865
</project>

fesod-examples/fesod-sheet-examples/src/test/resources/logback.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
2121
-->
2222
<configuration>
23-
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
24-
2523
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
2624
<encoder>
27-
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
25+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
2826
<charset>utf8</charset>
2927
</encoder>
3028
</appender>
3129

32-
<root level="DEBUG">
30+
<root level="INFO">
3331
<appender-ref ref="CONSOLE"/>
3432
</root>
33+
34+
<!-- Reduce noise from POI -->
35+
<logger name="org.apache.poi" level="WARN"/>
3536
</configuration>

fesod-sheet/src/test/resources/logback.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@
2020
2121
-->
2222
<configuration>
23-
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
24-
2523
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
2624
<encoder>
27-
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
25+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
2826
<charset>utf8</charset>
2927
</encoder>
3028
</appender>
3129

32-
<root level="DEBUG">
30+
<root level="INFO">
3331
<appender-ref ref="CONSOLE"/>
3432
</root>
33+
34+
<!-- Reduce noise from POI -->
35+
<logger name="org.apache.poi" level="WARN"/>
3536
</configuration>

pom.xml

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,13 @@
7070
<poi.version>5.5.1</poi.version>
7171
<ehcache.version>3.9.11</ehcache.version>
7272
<commons-io.version>2.21.0</commons-io.version>
73-
<slf4j-api.version>1.7.36</slf4j-api.version>
73+
<slf4j-api.version>2.0.17</slf4j-api.version>
7474
<lombok.version>1.18.42</lombok.version>
7575
<spring-core.version>5.3.39</spring-core.version>
7676
<fastjson2.version>2.0.60</fastjson2.version>
7777
<spring-boot-starter-web.version>2.7.18</spring-boot-starter-web.version>
78-
<slf4j-simple.version>1.7.36</slf4j-simple.version>
79-
<jcl-over-slf4j.version>1.7.36</jcl-over-slf4j.version>
80-
<log4j-over-slf4j.version>1.7.36</log4j-over-slf4j.version>
81-
<logback-classic.version>1.5.24</logback-classic.version>
78+
<log4j-to-slf4j.version>2.24.3</log4j-to-slf4j.version>
79+
<logback-classic.version>1.3.14</logback-classic.version>
8280
<mockserver.version>5.15.0</mockserver.version>
8381
<jacoco.version>0.8.14</jacoco.version>
8482
<junit.version>5.13.4</junit.version>
@@ -188,19 +186,9 @@
188186
<version>${fastjson2.version}</version>
189187
</dependency>
190188
<dependency>
191-
<groupId>org.slf4j</groupId>
192-
<artifactId>slf4j-simple</artifactId>
193-
<version>${slf4j-simple.version}</version>
194-
</dependency>
195-
<dependency>
196-
<groupId>org.slf4j</groupId>
197-
<artifactId>jcl-over-slf4j</artifactId>
198-
<version>${jcl-over-slf4j.version}</version>
199-
</dependency>
200-
<dependency>
201-
<groupId>org.slf4j</groupId>
202-
<artifactId>log4j-over-slf4j</artifactId>
203-
<version>${log4j-over-slf4j.version}</version>
189+
<groupId>org.apache.logging.log4j</groupId>
190+
<artifactId>log4j-to-slf4j</artifactId>
191+
<version>${log4j-to-slf4j.version}</version>
204192
</dependency>
205193
<dependency>
206194
<groupId>ch.qos.logback</groupId>
@@ -299,18 +287,8 @@
299287
<scope>test</scope>
300288
</dependency>
301289
<dependency>
302-
<groupId>org.slf4j</groupId>
303-
<artifactId>slf4j-simple</artifactId>
304-
<scope>test</scope>
305-
</dependency>
306-
<dependency>
307-
<groupId>org.slf4j</groupId>
308-
<artifactId>jcl-over-slf4j</artifactId>
309-
<scope>test</scope>
310-
</dependency>
311-
<dependency>
312-
<groupId>org.slf4j</groupId>
313-
<artifactId>log4j-over-slf4j</artifactId>
290+
<groupId>org.apache.logging.log4j</groupId>
291+
<artifactId>log4j-to-slf4j</artifactId>
314292
<scope>test</scope>
315293
</dependency>
316294
<dependency>

0 commit comments

Comments
 (0)