Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-302

Enable swapping of NOPLogger in SubstituteLoggerFactory

    Details

    • Type: Improvement
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.7.x
    • Fix Version/s: None
    • Component/s: Core API
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

      Description

      Currently the SubstituteLoggerFactory returns a NOPLogger while the LoggerFactory is getting initialzed. Due to this any Logger created during initialization period are not useful for the lifetime of the system. This is also explained here [1]. We are facing this issue while using Slf4j with logback in Sling which is an OSGi applicatopn [2]

      The fix suggested involves changes in the application using Slf4j. It would be simpler if the SubstituteLoggerFactory returns some forms of SubstitutableLogger which can delegate to a different logger impl. By default it uses NOPlogger. But later the delegate can be set to actual logger.

      [1] http://www.slf4j.org/codes.html#substituteLogger
      [2] https://issues.apache.org/jira/browse/SLING-3340

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                slf4j-dev SLF4J developers list
                Reporter:
                chetanm Chetan Mehrotra
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: