Package org.apache.logging.log4j.spi
Class Provider
java.lang.Object
org.apache.logging.log4j.spi.Provider
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
Modifier and TypeFieldDescriptionstatic final String
Property name to set for a Log4j 2 provider to specify the priority of this implementation.static final String
Property name to set to the implementation ofLoggerContextFactory
.static final String
Property name to set to the implementation ofThreadContextMap
. -
Constructor Summary
ConstructorDescriptionProvider
(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 TypeMethodDescriptionboolean
Gets the class name of theLoggerContextFactory
implementation of this Provider.Gets the priority (natural ordering) of this Provider.Gets the class name of theThreadContextMap
implementation of this Provider.getUrl()
Gets the URL containing this Provider's Log4j details.Returns the Log4j API versions supported by the implementation.int
hashCode()
Class<? extends LoggerContextFactory>
Loads theLoggerContextFactory
class specified by this Provider.Class<? extends ThreadContextMap>
Loads theThreadContextMap
class 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:
-
-
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 theLoggerContextFactory
implementation of this Provider.- Returns:
- the class name of a LoggerContextFactory implementation
-
loadLoggerContextFactory
Loads theLoggerContextFactory
class specified by this Provider.- Returns:
- the LoggerContextFactory implementation class or
null
if there was an error loading it
-
getThreadContextMap
Gets the class name of theThreadContextMap
implementation of this Provider.- Returns:
- the class name of a ThreadContextMap implementation
-
loadThreadContextMap
Loads theThreadContextMap
class specified by this Provider.- Returns:
- the ThreadContextMap implementation class or
null
if 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.properties
file
-
toString
-
equals
-
hashCode
public int hashCode()
-