Class AsyncLoggerContextSelector
- java.lang.Object
-
- org.apache.logging.log4j.core.selector.ClassLoaderContextSelector
-
- org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
-
- All Implemented Interfaces:
ContextSelector
,LoggerContextShutdownAware
@Singleton public class AsyncLoggerContextSelector extends ClassLoaderContextSelector
ContextSelector
that managesAsyncLoggerContext
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
contextMap, defaultContext, injector, LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.selector.ContextSelector
DEFAULT_STOP_TIMEOUT, KEY
-
-
Constructor Summary
Constructors Constructor Description AsyncLoggerContextSelector(org.apache.logging.log4j.plugins.di.Injector injector)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LoggerContext
createContext(String name, URI configLocation, org.apache.logging.log4j.plugins.di.Injector injector)
protected String
defaultContextName()
static boolean
isSelected()
Returnstrue
if the user specified this selector as the Log4jContextSelector, to make all loggers asynchronous.protected String
toContextMapKey(ClassLoader loader)
-
Methods inherited from class org.apache.logging.log4j.core.selector.ClassLoaderContextSelector
contextShutdown, createContext, 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()
Returnstrue
if the user specified this selector as the Log4jContextSelector, to make all loggers asynchronous.- Returns:
true
if all loggers are asynchronous,false
otherwise.
-
createContext
protected LoggerContext createContext(String name, URI configLocation, org.apache.logging.log4j.plugins.di.Injector injector)
- Overrides:
createContext
in classClassLoaderContextSelector
-
toContextMapKey
protected String toContextMapKey(ClassLoader loader)
- Overrides:
toContextMapKey
in classClassLoaderContextSelector
-
defaultContextName
protected String defaultContextName()
- Overrides:
defaultContextName
in classClassLoaderContextSelector
-
-