Package org.apache.logging.log4j.spi
Class Provider
- java.lang.Object
-
- org.apache.logging.log4j.spi.Provider
-
public class Provider extends Object
Model class for a Log4j 2 provider. The properties in this class correspond to the properties used in aMETA-INF/log4j-provider.properties
file. Note that this class is automatically created by Log4j and should not be used by providers.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FACTORY_PRIORITY
Property name to set for a Log4j 2 provider to specify the priority of this implementation.static String
LOGGER_CONTEXT_FACTORY
Property name to set to the implementation ofLoggerContextFactory
.static String
THREAD_CONTEXT_MAP
Property name to set to the implementation ofThreadContextMap
.
-
Constructor Summary
Constructors Constructor Description Provider(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getClassName()
Gets the class name of theLoggerContextFactory
implementation of this Provider.Integer
getPriority()
Gets the priority (natural ordering) of this Provider.String
getThreadContextMap()
Gets the class name of theThreadContextMap
implementation of this Provider.URL
getUrl()
Gets the URL containing this Provider's Log4j details.String
getVersions()
Returns the Log4j API versions supported by the implementation.int
hashCode()
Class<? extends LoggerContextFactory>
loadLoggerContextFactory()
Loads theLoggerContextFactory
class specified by this Provider.Class<? extends ThreadContextMap>
loadThreadContextMap()
Loads theThreadContextMap
class specified by this Provider.String
toString()
-
-
-
Field Detail
-
FACTORY_PRIORITY
public static final String FACTORY_PRIORITY
Property name to set for a Log4j 2 provider to specify the priority of this implementation.- See Also:
- Constant Field Values
-
THREAD_CONTEXT_MAP
public static final String THREAD_CONTEXT_MAP
Property name to set to the implementation ofThreadContextMap
.- See Also:
- Constant Field Values
-
LOGGER_CONTEXT_FACTORY
public static final String LOGGER_CONTEXT_FACTORY
Property name to set to the implementation ofLoggerContextFactory
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Provider
public Provider(Properties props, URL url, ClassLoader classLoader)
-
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 Detail
-
getVersions
public String getVersions()
Returns the Log4j API versions supported by the implementation.- Returns:
- A String containing the Log4j versions supported.
-
getPriority
public Integer getPriority()
Gets the priority (natural ordering) of this Provider.- Returns:
- the priority of this Provider
-
getClassName
public String getClassName()
Gets the class name of theLoggerContextFactory
implementation of this Provider.- Returns:
- the class name of a LoggerContextFactory implementation
-
loadLoggerContextFactory
public Class<? extends LoggerContextFactory> loadLoggerContextFactory()
Loads theLoggerContextFactory
class specified by this Provider.- Returns:
- the LoggerContextFactory implementation class or
null
if there was an error loading it
-
getThreadContextMap
public String getThreadContextMap()
Gets the class name of theThreadContextMap
implementation of this Provider.- Returns:
- the class name of a ThreadContextMap implementation
-
loadThreadContextMap
public Class<? extends ThreadContextMap> loadThreadContextMap()
Loads theThreadContextMap
class specified by this Provider.- Returns:
- the ThreadContextMap implementation class or
null
if there was an error loading it
-
getUrl
public URL getUrl()
Gets the URL containing this Provider's Log4j details.- Returns:
- the URL corresponding to the Provider
META-INF/log4j-provider.properties
file
-
-