Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17586

spring-jcl routes logging inefficiently against SLF4J with log4j-to-slf4j setup

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 5.0.11, 5.1.3
    • Fix Version/s: 5.1.4
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      If org.apache.logging.log4j.spi.ExtendedLogger (part of log4j-api) is on the classpath, spring-jcl will produce a org.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 its log4j-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 in log4j-core's absence:

      Commons Logging -> SLF4J -> Logging back end

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              awilkinson Andy Wilkinson
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 19 weeks, 4 days ago