org.apache.logging.log4j.spi
Class Provider

java.lang.Object
  extended by 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 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
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 of LoggerContextFactory.
static String THREAD_CONTEXT_MAP
          Property name to set to the implementation of ThreadContextMap.
 
Constructor Summary
Provider(Properties props, URL url, ClassLoader classLoader)
           
 
Method Summary
 String getClassName()
          Gets the class name of the LoggerContextFactory implementation of this Provider.
 Integer getPriority()
          Gets the priority (natural ordering) of this Provider.
 String getThreadContextMap()
          Gets the class name of the ThreadContextMap implementation of this Provider.
 URL getUrl()
          Gets the URL containing this Provider's Log4j details.
 Class<? extends LoggerContextFactory> loadLoggerContextFactory()
          Loads the LoggerContextFactory class specified by this Provider.
 Class<? extends ThreadContextMap> loadThreadContextMap()
          Loads the ThreadContextMap class specified by this Provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 of ThreadContextMap.

See Also:
Constant Field Values

LOGGER_CONTEXT_FACTORY

public static final String LOGGER_CONTEXT_FACTORY
Property name to set to the implementation of LoggerContextFactory.

See Also:
Constant Field Values
Constructor Detail

Provider

public Provider(Properties props,
                URL url,
                ClassLoader classLoader)
Method Detail

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 the LoggerContextFactory implementation of this Provider.

Returns:
the class name of a LoggerContextFactory implementation

loadLoggerContextFactory

public Class<? extends LoggerContextFactory> loadLoggerContextFactory()
Loads the LoggerContextFactory 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 the ThreadContextMap implementation of this Provider.

Returns:
the class name of a ThreadContextMap implementation

loadThreadContextMap

public Class<? extends ThreadContextMap> loadThreadContextMap()
Loads the ThreadContextMap 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


Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.