Class AsyncLoggerContextSelector
java.lang.Object
org.apache.logging.log4j.core.selector.ClassLoaderContextSelector
org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
- All Implemented Interfaces:
ContextSelector,LoggerContextShutdownAware
ContextSelector that manages AsyncLoggerContext instances.
As of version 2.5, this class extends ClassLoaderContextSelector for better web app support.
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.selector.ClassLoaderContextSelector
CONTEXT_MAP, LOGGERFields inherited from interface org.apache.logging.log4j.core.selector.ContextSelector
DEFAULT_STOP_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LoggerContextcreateContext(String name, URI configLocation) protected Stringstatic booleanReturnstrueif the user specified this selector as the Log4jContextSelector, to make all loggers asynchronous.protected StringtoContextMapKey(ClassLoader loader) Methods inherited from class org.apache.logging.log4j.core.selector.ClassLoaderContextSelector
contextShutdown, getContext, getContext, getContext, getDefault, getLoggerContexts, hasContext, isClassLoaderDependent, removeContext, shutdownMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.selector.ContextSelector
getContext
-
Constructor Details
-
AsyncLoggerContextSelector
public AsyncLoggerContextSelector()
-
-
Method Details
-
isSelected
public static boolean isSelected()Returnstrueif the user specified this selector as the Log4jContextSelector, to make all loggers asynchronous.- Returns:
trueif all loggers are asynchronous,falseotherwise.
-
createContext
- Overrides:
createContextin classClassLoaderContextSelector
-
toContextMapKey
- Overrides:
toContextMapKeyin classClassLoaderContextSelector
-
defaultContextName
- Overrides:
defaultContextNamein classClassLoaderContextSelector
-