[slf4j-dev] [Bug 293] New: Unusable with Logback-ContextSelectors.

bugzilla-daemon at qos.ch bugzilla-daemon at qos.ch
Tue Feb 19 15:11:24 CET 2013


http://bugzilla.slf4j.org/show_bug.cgi?id=293

           Summary: Unusable with Logback-ContextSelectors.
           Product: SLF4J
           Version: 1.7.x
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: jcl-over-slf4j
        AssignedTo: slf4j-dev at qos.ch
        ReportedBy: thomas.moeller at continentale.de


Caching instances of Slf4j-Loggers prevents Logback-ContextSelectors from
working. (See also bug 291 for a similar issue with the log4j bridge.)

The caching code can be found in
org.apache.commons.logging.impl.SLF4JLogFactory:

  public Log getInstance(String name) throws LogConfigurationException {
    Log instance = null;
    // protect against concurrent access of loggerMap
    synchronized (loggerMap) {
      instance = (Log) loggerMap.get(name);
      if (instance == null) {
        Logger logger = LoggerFactory.getLogger(name);
        if(logger instanceof LocationAwareLogger) {
          instance = new SLF4JLocationAwareLog((LocationAwareLogger) logger);
        } else {
          instance = new SLF4JLog(logger);
        }
        loggerMap.put(name, instance);
      }
    }
    return (instance);

  }

-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the slf4j-dev mailing list