Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(doc) Update log4j-spring-boot spring-boot min version #1652

Closed

Conversation

SebHeuze
Copy link

@SebHeuze SebHeuze commented Aug 1, 2023

Since log4j-spring-boot 2.18.0 the required Spring Boot version is now 2.4.0 since it use LoggingSystemFactory which is a spring boot 2.4.0 class
https://docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/logging/LoggingSystemFactory.html

@ppkarwasz
Copy link
Contributor

Hi @SebHeuze,

The story is a little bit more complicated than that.

Before Spring Boot 2.4.0 the only way to select a Spring Boot LoggingSystem was to set a system property:

org.springframework.boot.logging.LoggingSystem=org.apache.logging.log4j.spring.boot.Log4j2SpringBootLoggingSystem

This method is still valid with all the Spring Boot versions mentioned in the docs.

Log4j2 2.17.2 or earlier used a log4j2.system.properties file (cf. System Properties) embedded in the log4j-spring-boot JAR file to set this property. This method effectively prevents the usage of any other LoggingSystem (including the original Spring Boot's Log4j2LoggingSystem) and was removed in #777.

Since Spring Boot 2.4.0 a new mechanism to register a LoggingSystem is available: spring.factories (cf. SpringFactoriesLoader. This is the mechanism adopted by Log4j 2.18.0 and later versions.

@SebHeuze
Copy link
Author

SebHeuze commented Aug 1, 2023

Yes you are right, my mistake was because the project that had the issue forced the log4j version so I had the compatibility issue with 2.3.9

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.

None yet

2 participants