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
Clean logging dependencies #11148
Comments
Thanks. That's an oversight and we should tidy it up.
This was intentional, but perhaps it's becoming unnecessary? The reason behind keeping the dependency was that we still want to be able to bridge the logging from libraries that use Log4J 1 into SLF4J.
Thanks. We should tidy this up too. |
Since Log4J 1.x has been EOL'ed in 2015, I doubt that there any relevant libraries using it still... in particular through its native API. There might just be the odd setup out there using it behind Commons Logging still. From that perspective, I would simply drop that Log4J 1.2 API bridge for good... also removing an inconsistency between the Logback vs Log4J 2 starters (where the similarly purposed |
We still have a number of Spring projects that depend upon it either directly or transitively. Those appear to be:
Spring Batch seems to be the most dependent on Log4J 1.x. Hopefully @mminella can tidy that up rather than carrying support into the new 4.x major line. Spring Kafka's transitive dependency is via Kafka and, I think, a ZooKeeper client library that only affects Spring Retry seems to build happily without its optional Log4j 1.2 dependency, so I think we're in the clear there. |
It was only a test that was actually using Log4j in Batch so I think we can go ahead and tidy all of this up in M7. |
I missed one in |
@wilkinsona According to https://freemarker.apache.org/docs/pgui_misc_logging.html freemarker 2.3.* needs log4j-over-slf4j removed in this issue (still this version in https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-dependencies/pom.xml ) |
Thanks, @isopov. By my reading of the FreeMarker documentation, we're ok here. It'll now use JUL (rather than SLF4J/Log4J) which should still be routed into Logback. |
Our FreeMarker sample, with debug logging enabled, produces output similar to the following:
I think we're fine to drop the old Log4J 1 bridge. We'll keep dependency management for it (as it's part of SLF4J which we manage) so it's easy for people to add in themselves if they really need to do so. |
Alternatively, one could set Also, Boot's Log4J 2 starter never included such a Log4J 1.2 API bridge. So I suppose FreeMarker was always logging through JUL there anyway? In any case, this is also about consistency between those logging starters, so even just for that reason we should push forward here. |
The Spring Boot 2.0 starters seem to have a few oddities in master still:
The core starter excludes
commons-logging
fromspring-core
(which isn't necessary anymore with Spring Framework 5.0'sspring-jcl
arrangement).spring-boot-starter-logging
brings inlog4j-over-slf4j
which is a legacy Log4J 1.2 API binding (EOL'ed). Isn't it just meant to bring inlog4j-to-slf4j
for the Log4J 2.x API binding?spring-boot-starter-log4j2
brings inlog4j-core
as well aslog4j-api
but the latter is a transitive dependency of the former anyway, at least in all recent versions.The text was updated successfully, but these errors were encountered: