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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondetachLoggerContext(String loggerContextName) intgetCount()Returns the number of managed contexts Used for testing purposesgetLoggerContext(String name) voidvoidsetLocalContext(LoggerContext context) These methods are used by the LoggerContextFilter.
-
Constructor Details
-
ContextJNDISelector
-
-
Method Details
-
getDefaultLoggerContext
- Specified by:
getDefaultLoggerContextin interfaceContextSelector
-
detachLoggerContext
- Specified by:
detachLoggerContextin interfaceContextSelector
-
getLoggerContext
- Specified by:
getLoggerContextin interfaceContextSelector
-
getContextNames
- Specified by:
getContextNamesin interfaceContextSelector
-
getLoggerContext
- Specified by:
getLoggerContextin 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
-