spring-jcl routes logging inefficiently against SLF4J with log4j-to-slf4j setup [SPR-17586] #22118
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Andy Wilkinson opened SPR-17586 and commented
If
org.apache.logging.log4j.spi.ExtendedLogger
(part oflog4j-api
) is on the classpath,spring-jcl
will produce aorg.apache.commons.logging.Log
that logs by delegating to the Log4j2 API. In a setup where Log4j 2's implementation is not on the classpath and itslog4j-to-slf4j
module is being used to route logging performed via the Log4j 2 API into SLF4J, this isn't as efficient as it could be. It leaves logging being routed as follows:Commons Logging -> Log4j2 -> SLF4J -> Logging back end
If a check was made for a type from
log4j-core
before choosing to route into Log4j2, this could be more efficient inlog4j-core
's absence:Commons Logging -> SLF4J -> Logging back end
Affects: 5.0.11, 5.1.3
Issue Links:
Referenced from: commits 4b45030
The text was updated successfully, but these errors were encountered: