Class AsyncLoggerContextSelector
- java.lang.Object
-
- org.apache.logging.log4j.core.selector.ClassLoaderContextSelector
-
- org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
-
- All Implemented Interfaces:
ContextSelector,LoggerContextShutdownAware
public class AsyncLoggerContextSelector extends ClassLoaderContextSelector
ContextSelectorthat managesAsyncLoggerContextinstances.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, LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.selector.ContextSelector
DEFAULT_STOP_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description AsyncLoggerContextSelector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LoggerContextcreateContext(String name, URI configLocation)protected StringdefaultContextName()static booleanisSelected()Returnstrueif 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, shutdown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.logging.log4j.core.selector.ContextSelector
getContext
-
-
-
-
Method Detail
-
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
protected LoggerContext createContext(String name, URI configLocation)
- Overrides:
createContextin classClassLoaderContextSelector
-
toContextMapKey
protected String toContextMapKey(ClassLoader loader)
- Overrides:
toContextMapKeyin classClassLoaderContextSelector
-
defaultContextName
protected String defaultContextName()
- Overrides:
defaultContextNamein classClassLoaderContextSelector
-
-