org.apache.logging.log4j.core.config
Interface Configuration

All Superinterfaces:
Filterable, LifeCycle
All Known Implementing Classes:
AbstractConfiguration, DefaultConfiguration, JsonConfiguration, NullConfiguration, XmlConfiguration, YamlConfiguration

public interface Configuration
extends Filterable

Interface that must be implemented to create a configuration.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
 
Field Summary
static String CONTEXT_PROPERTIES
          Key for storing the Context properties.
 
Method Summary
 void addAppender(Appender appender)
           
 void addComponent(String name, Object object)
           
 void addListener(ConfigurationListener listener)
           
 void addLogger(String name, LoggerConfig loggerConfig)
           
 void addLoggerAppender(Logger logger, Appender appender)
           
 void addLoggerFilter(Logger logger, Filter filter)
           
 void createConfiguration(Node node, LogEvent event)
           
 Advertiser getAdvertiser()
           
 Appender getAppender(String name)
          Returns the Appender with the specified name.
 Map<String,Appender> getAppenders()
          Returns a Map containing all the Appenders and their name.
<T> T
getComponent(String name)
           
 ConfigurationMonitor getConfigurationMonitor()
           
 ConfigurationSource getConfigurationSource()
          Returns the source of this configuration.
 LoggerConfig getLoggerConfig(String name)
          Locates the appropriate LoggerConfig for a Logger name.
 Map<String,LoggerConfig> getLoggers()
           
 String getName()
          Returns the configuration name.
 Map<String,String> getProperties()
           
 StrSubstitutor getStrSubstitutor()
           
 boolean isShutdownHookEnabled()
           
 void removeListener(ConfigurationListener listener)
           
 void removeLogger(String name)
           
 void setAdvertiser(Advertiser advertiser)
           
 void setConfigurationMonitor(ConfigurationMonitor monitor)
           
 void setLoggerAdditive(Logger logger, boolean additive)
           
 
Methods inherited from interface org.apache.logging.log4j.core.filter.Filterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter
 
Methods inherited from interface org.apache.logging.log4j.core.LifeCycle
isStarted, isStopped, start, stop
 

Field Detail

CONTEXT_PROPERTIES

static final String CONTEXT_PROPERTIES
Key for storing the Context properties.

See Also:
Constant Field Values
Method Detail

getName

String getName()
Returns the configuration name.

Returns:
the name of the configuration.

getLoggerConfig

LoggerConfig getLoggerConfig(String name)
Locates the appropriate LoggerConfig for a Logger name. This will remove tokens from the package name as necessary or return the root LoggerConfig if no other matches were found.

Parameters:
name - The Logger name.
Returns:
The located LoggerConfig.

getAppender

Appender getAppender(String name)
Returns the Appender with the specified name.

Parameters:
name - The name of the Appender.
Returns:
the Appender with the specified name or null if the Appender cannot be located.

getAppenders

Map<String,Appender> getAppenders()
Returns a Map containing all the Appenders and their name.

Returns:
A Map containing each Appender's name and the Appender object.

addAppender

void addAppender(Appender appender)

getLoggers

Map<String,LoggerConfig> getLoggers()

addLoggerAppender

void addLoggerAppender(Logger logger,
                       Appender appender)

addLoggerFilter

void addLoggerFilter(Logger logger,
                     Filter filter)

setLoggerAdditive

void setLoggerAdditive(Logger logger,
                       boolean additive)

addLogger

void addLogger(String name,
               LoggerConfig loggerConfig)

removeLogger

void removeLogger(String name)

getProperties

Map<String,String> getProperties()

addListener

void addListener(ConfigurationListener listener)

removeListener

void removeListener(ConfigurationListener listener)

getStrSubstitutor

StrSubstitutor getStrSubstitutor()

createConfiguration

void createConfiguration(Node node,
                         LogEvent event)

getComponent

<T> T getComponent(String name)

addComponent

void addComponent(String name,
                  Object object)

setConfigurationMonitor

void setConfigurationMonitor(ConfigurationMonitor monitor)

getConfigurationMonitor

ConfigurationMonitor getConfigurationMonitor()

setAdvertiser

void setAdvertiser(Advertiser advertiser)

getAdvertiser

Advertiser getAdvertiser()

isShutdownHookEnabled

boolean isShutdownHookEnabled()

getConfigurationSource

ConfigurationSource getConfigurationSource()
Returns the source of this configuration.

Returns:
the source of this configuration


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.