Class Log4jProvider
- java.lang.Object
-
- org.apache.logging.log4j.spi.Provider
-
- org.apache.logging.log4j.core.impl.Log4jProvider
-
@NullMarked public class Log4jProvider extends Provider
Binding for the Log4j API.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringDISABLE_CONTEXT_MAPprivate static java.lang.StringDISABLE_THREAD_CONTEXTprivate static java.lang.StringGARBAGE_FREE_CLASS_NAMEprivate static java.lang.StringGARBAGE_FREE_CONTEXT_MAPConstant used to select a garbage-free implementation ofThreadContextMap.private static java.lang.StringGC_FREE_THREAD_CONTEXT_PROPERTYprivate static LoggerLOGGERprivate Lazy<LoggerContextFactory>loggerContextFactoryLazyprivate static java.lang.StringNO_OP_CONTEXT_MAPConstant used to disable theThreadContextMap.private static java.lang.StringTHREAD_CONTEXT_MAP_PROPERTYprivate Lazy<ThreadContextMap>threadContextMapLazyprivate static java.lang.StringWEB_APP_CLASS_NAMEprivate static java.lang.StringWEB_APP_CONTEXT_MAPConstant used to select a web application-safe implementation ofThreadContextMap.-
Fields inherited from class org.apache.logging.log4j.spi.Provider
CURRENT_VERSION, FACTORY_PRIORITY, LOGGER_CONTEXT_FACTORY, PROVIDER_PROPERTY_NAME, THREAD_CONTEXT_MAP
-
-
Constructor Summary
Constructors Constructor Description Log4jProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private ThreadContextMapcreateThreadContextMap()LoggerContextFactorygetLoggerContextFactory()ThreadContextMapgetThreadContextMapInstance()(package private) voidresetThreadContextMap()-
Methods inherited from class org.apache.logging.log4j.spi.Provider
equals, getClassName, getPriority, getThreadContextMap, getUrl, getVersions, hashCode, loadLoggerContextFactory, loadThreadContextMap, toString
-
-
-
-
Field Detail
-
NO_OP_CONTEXT_MAP
private static final java.lang.String NO_OP_CONTEXT_MAP
Constant used to disable theThreadContextMap.Warning: the value of this constant does not point to a concrete class name.
-
WEB_APP_CONTEXT_MAP
private static final java.lang.String WEB_APP_CONTEXT_MAP
Constant used to select a web application-safe implementation ofThreadContextMap.This implementation only binds JRE classes to
ThreadLocalvariables.Warning: the value of this constant does not point to a concrete class name.
-
GARBAGE_FREE_CONTEXT_MAP
private static final java.lang.String GARBAGE_FREE_CONTEXT_MAP
Constant used to select a garbage-free implementation ofThreadContextMap.This implementation must ensure that common operations don't create new object instances. The drawback is the necessity to bind custom classes to
ThreadLocalvariables.Warning: the value of this constant does not point to a concrete class name.
-
DISABLE_CONTEXT_MAP
private static final java.lang.String DISABLE_CONTEXT_MAP
- See Also:
- Constant Field Values
-
DISABLE_THREAD_CONTEXT
private static final java.lang.String DISABLE_THREAD_CONTEXT
- See Also:
- Constant Field Values
-
THREAD_CONTEXT_MAP_PROPERTY
private static final java.lang.String THREAD_CONTEXT_MAP_PROPERTY
- See Also:
- Constant Field Values
-
GC_FREE_THREAD_CONTEXT_PROPERTY
private static final java.lang.String GC_FREE_THREAD_CONTEXT_PROPERTY
- See Also:
- Constant Field Values
-
WEB_APP_CLASS_NAME
private static final java.lang.String WEB_APP_CLASS_NAME
- See Also:
- Constant Field Values
-
GARBAGE_FREE_CLASS_NAME
private static final java.lang.String GARBAGE_FREE_CLASS_NAME
- See Also:
- Constant Field Values
-
LOGGER
private static final Logger LOGGER
-
loggerContextFactoryLazy
private final Lazy<LoggerContextFactory> loggerContextFactoryLazy
-
threadContextMapLazy
private final Lazy<ThreadContextMap> threadContextMapLazy
-
-
Method Detail
-
getLoggerContextFactory
public LoggerContextFactory getLoggerContextFactory()
- Overrides:
getLoggerContextFactoryin classProvider- Returns:
- The logger context factory to be used by
LogManager.
-
getThreadContextMapInstance
public ThreadContextMap getThreadContextMapInstance()
- Overrides:
getThreadContextMapInstancein classProvider- Returns:
- The thread context map to be used by
ThreadContext.
-
createThreadContextMap
private ThreadContextMap createThreadContextMap()
-
resetThreadContextMap
void resetThreadContextMap()
-
-