Details
-
Bug
-
Resolution: Unresolved
-
None
-
1.7.x
-
None
-
Operating System: Windows XP
Platform: PC
-
major
-
P1
-
293
Description
Caching instances of Slf4j-Loggers prevents Logback-ContextSelectors from working. (See also SLF4J-282 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)
else
{ instance = new SLF4JLog(logger); } loggerMap.put(name, instance);
}
}
return (instance);
}