Package org.apache.logging.log4j.spi
Class Provider
java.lang.Object
org.apache.logging.log4j.spi.Provider
- Direct Known Subclasses:
JULProvider,Log4jProvider,SLF4JProvider
Model class for a Log4j 2 provider. The properties in this class correspond to the properties used in a
META-INF/log4j-provider.properties file. Note that this class is automatically created by Log4j and should
not be used by providers.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WeakReference<ClassLoader> private final Stringprivate static final Integerstatic final StringProperty name to set for a Log4j 2 provider to specify the priority of this implementation.private static final Loggerstatic final StringProperty name to set to the implementation ofLoggerContextFactory.private final Class<? extends LoggerContextFactory> private final Integerstatic final StringProperty name to set to the implementation ofThreadContextMap.private final Stringprivate final Class<? extends ThreadContextMap> private final URLprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionProvider(Integer priority, String versions, Class<? extends LoggerContextFactory> loggerContextFactoryClass) Provider(Integer priority, String versions, Class<? extends LoggerContextFactory> loggerContextFactoryClass, Class<? extends ThreadContextMap> threadContextMapClass) Provider(Properties props, URL url, ClassLoader classLoader) -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the class name of theLoggerContextFactoryimplementation of this Provider.Gets the priority (natural ordering) of this Provider.Gets the class name of theThreadContextMapimplementation of this Provider.getUrl()Gets the URL containing this Provider's Log4j details.Returns the Log4j API versions supported by the implementation.inthashCode()Class<? extends LoggerContextFactory> Loads theLoggerContextFactoryclass specified by this Provider.Class<? extends ThreadContextMap> Loads theThreadContextMapclass specified by this Provider.toString()
-
Field Details
-
FACTORY_PRIORITY
Property name to set for a Log4j 2 provider to specify the priority of this implementation.- See Also:
-
THREAD_CONTEXT_MAP
Property name to set to the implementation ofThreadContextMap.- See Also:
-
LOGGER_CONTEXT_FACTORY
Property name to set to the implementation ofLoggerContextFactory.- See Also:
-
DEFAULT_PRIORITY
-
LOGGER
-
priority
-
className
-
loggerContextFactoryClass
-
threadContextMap
-
threadContextMapClass
-
versions
-
url
-
classLoader
-
-
Constructor Details
-
Provider
-
Provider
public Provider(Integer priority, String versions, Class<? extends LoggerContextFactory> loggerContextFactoryClass) -
Provider
public Provider(Integer priority, String versions, Class<? extends LoggerContextFactory> loggerContextFactoryClass, Class<? extends ThreadContextMap> threadContextMapClass)
-
-
Method Details
-
getVersions
Returns the Log4j API versions supported by the implementation.- Returns:
- A String containing the Log4j versions supported.
-
getPriority
Gets the priority (natural ordering) of this Provider.- Returns:
- the priority of this Provider
-
getClassName
Gets the class name of theLoggerContextFactoryimplementation of this Provider.- Returns:
- the class name of a LoggerContextFactory implementation
-
loadLoggerContextFactory
Loads theLoggerContextFactoryclass specified by this Provider.- Returns:
- the LoggerContextFactory implementation class or
nullif there was an error loading it
-
getThreadContextMap
Gets the class name of theThreadContextMapimplementation of this Provider.- Returns:
- the class name of a ThreadContextMap implementation
-
loadThreadContextMap
Loads theThreadContextMapclass specified by this Provider.- Returns:
- the ThreadContextMap implementation class or
nullif there was an error loading it
-
getUrl
Gets the URL containing this Provider's Log4j details.- Returns:
- the URL corresponding to the Provider
META-INF/log4j-provider.propertiesfile
-
toString
-
equals
-
hashCode
public int hashCode()
-