java.lang.Object
ch.qos.logback.classic.selector.ContextJNDISelector
- All Implemented Interfaces:
ContextSelector
A class that allows the LoggerFactory to access an environment-based
LoggerContext.
To add in catalina.sh
JAVA_OPTS="$JAVA_OPTS "-Dlogback.ContextSelector=JNDI""
- Author:
- Ceki Gülcü, Sébastien Pennec
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondetachLoggerContext
(String loggerContextName) int
getCount()
Returns the number of managed contexts Used for testing purposesgetLoggerContext
(String name) void
void
setLocalContext
(LoggerContext context) These methods are used by the LoggerContextFilter.
-
Constructor Details
-
ContextJNDISelector
-
-
Method Details
-
getDefaultLoggerContext
- Specified by:
getDefaultLoggerContext
in interfaceContextSelector
-
detachLoggerContext
- Specified by:
detachLoggerContext
in interfaceContextSelector
-
getLoggerContext
- Specified by:
getLoggerContext
in interfaceContextSelector
-
getContextNames
- Specified by:
getContextNames
in interfaceContextSelector
-
getLoggerContext
- Specified by:
getLoggerContext
in interfaceContextSelector
-
getCount
Returns the number of managed contexts Used for testing purposes- Returns:
- the number of managed contexts
-
setLocalContext
These methods are used by the LoggerContextFilter. They provide a way to tell the selector which context to use, thus saving the cost of a JNDI call at each new request.- Parameters:
context
-
-
removeLocalContext
-