Skip to content

Conversation

@GOODBOY008
Copy link
Member

@GOODBOY008 GOODBOY008 commented Dec 28, 2025

Summary

This PR fixes the compatibility issue between logback-classic and slf4j-api, and removes the erroneous Spring Boot configuration from logback.xml.

Changes

1. Update logback-classic version (pom.xml)

  • Changed `logback-classic.version` from `1.5.24` to `1.3.14`
  • Logback 1.3.x is the last version compatible with Java 8 (while supporting SLF4J 2.x)
  • Logback 1.4.x/1.5.x requires Java 11+

2. Update slf4j-api version (pom.xml)

  • Changed `slf4j-api.version` from `1.7.36` to `2.0.17`
  • SLF4J 2.0.x is compatible with Java 8+ and works with Logback 1.3.x

3. Replace log bridging dependencies (pom.xml)

  • Replaced `slf4j-simple`, `jcl-over-slf4j`, `log4j-over-slf4j` with `log4j-to-slf4j`
  • Simplifies the logging configuration and avoids binding conflicts

4. Fix logback.xml configuration

  • Removed `<include resource="org/springframework/boot/logging/logback/defaults.xml"/>` (not available in test classpath)
  • Added explicit log pattern definition
  • Changed root log level from `DEBUG` to `INFO` for cleaner test output
  • Added POI logger configuration to reduce noise

Compatibility Matrix

Component Version Java Compatibility
slf4j-api 2.0.17 Java 8+
logback-classic 1.3.14 Java 8+
logback-core 1.3.14 Java 8+

Copilot AI review requested due to automatic review settings December 28, 2025 12:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses SLF4J and Logback compatibility issues by removing the slf4j-simple binding in favor of logback-classic and fixing Logback configuration files to remove Spring Boot-specific elements that are not supported in standard Logback.

Key changes:

  • Removed slf4j-simple dependency and its version property from the parent POM
  • Downgraded logback-classic version from 1.5.23 to 1.2.13
  • Updated fesod-sheet test logback configuration to use standard Logback properties instead of Spring Boot includes

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pom.xml Removed slf4j-simple dependency and version property, downgraded logback-classic version to 1.2.13, and removed slf4j-simple from parent dependencies
fesod-sheet/src/test/resources/logback.xml Replaced Spring Boot logback include with standard property definition and changed root log level from DEBUG to INFO

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GOODBOY008
Copy link
Member Author

@alaahong @delei lei PTAL

@alaahong
Copy link
Member

why not upgrade to slf4j 2.x ?
And meanwhile, can you also attach the screenshot of actual execution log?

@GOODBOY008
Copy link
Member Author

@alaahong It’s fine for me to upgrade SLF4J to 2.x, as long as we can reach a consensus.Considered both options—upgrading SLF4J and staying with SLF4J 1.7.x. To minimize risk and scope of change, I chose the minimal-change approach by downgrading logback-classic.

Issue:

Compatibility Issue

  • Logback 1.5.x requires SLF4J 2.0.x, but this project uses SLF4J 1.7.36

Redundant Issue

  • The project has both slf4j-simple and logback-classic as test dependencies,slf4j-simple and logback-classic are competing SLF4J implementations

Log output in console (Before)

image

Log output in console (Remove slf4j-simple)

image

Log output in console (Apply the current pr)

image

@GOODBOY008 GOODBOY008 force-pushed the hotfix/log branch 4 times, most recently from c1edafc to f5cae74 Compare January 16, 2026 08:02
@GOODBOY008
Copy link
Member Author

GOODBOY008 commented Jan 16, 2026

@alaahong PR updated. SLF4J has been upgraded to 2.x, and logback-classic has been downgraded to 1.3.x to maintain Java 8 compatibility.

企业微信截图_f0af6e06-aed4-45a3-915c-e54ef6762122

Reference:

Java Logging Part 2: Logging and Package Exclusion with SLF4J + Logback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants