|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.logging.log4j.core.filter.Filterable
org.apache.logging.log4j.core.config.BaseConfiguration
public class BaseConfiguration
The Base Configuration. Many configuration implementations will extend this class.
Field Summary | |
---|---|
protected List<ConfigurationListener> |
listeners
Listeners for configuration changes. |
protected static Logger |
LOGGER
Allow subclasses access to the status logger without creating another instance. |
protected ConfigurationMonitor |
monitor
The ConfigurationMonitor that checks for configuration changes. |
protected PluginManager |
pluginManager
The Plugin Manager. |
protected Node |
rootNode
The root node of the configuration. |
Constructor Summary | |
---|---|
protected |
BaseConfiguration()
Constructor. |
Method Summary | |
---|---|
void |
addAppender(Appender appender)
Adds an Appender to the configuration. |
void |
addComponent(String name,
Object obj)
|
void |
addListener(ConfigurationListener listener)
Add a listener for changes on the configuration. |
void |
addLogger(String name,
LoggerConfig loggerConfig)
Adding a logger cannot be done atomically so is not allowed in an active configuration. |
void |
addLoggerAppender(Logger logger,
Appender appender)
Associates an Appender with a LoggerConfig. |
void |
addLoggerFilter(Logger logger,
Filter filter)
Associates a Filter with a LoggerConfig. |
void |
createConfiguration(Node node,
LogEvent event)
|
protected void |
doConfigure()
|
Appender |
getAppender(String name)
Return the Appender with the specified name. |
Map<String,Appender> |
getAppenders()
Return a Map containing all the Appenders and their name. |
Object |
getComponent(String name)
|
ConfigurationMonitor |
getConfigurationMonitor()
|
LoggerConfig |
getLogger(String name)
Returns the LoggerConfig with the specified name. |
LoggerConfig |
getLoggerConfig(String name)
Locates the appropriate LoggerConfig for a Logger name. |
Map<String,LoggerConfig> |
getLoggers()
Return a Map of all the LoggerConfigs. |
String |
getName()
Return the name of the configuration. |
protected PluginManager |
getPluginManager()
|
LoggerConfig |
getRootLogger()
Returns the root Logger. |
StrSubstitutor |
getSubst()
|
void |
removeAppender(String name)
Remove an Appender. |
void |
removeListener(ConfigurationListener listener)
Remove a ConfigurationListener. |
void |
removeLogger(String name)
Removing a logger cannot be done atomically so is not allowed in an active configuration. |
void |
setLoggerAdditive(Logger logger,
boolean additive)
Marks a LoggerConfig as additive. |
void |
setName(String name)
Set the name of the configuration. |
protected void |
setup()
|
void |
start()
Initialize the configuration. |
void |
stop()
Tear down the configuration. |
Methods inherited from class org.apache.logging.log4j.core.filter.Filterable |
---|
addFilter, getFilter, hasFilter, isFiltered, removeFilter, startFilter, stopFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.logging.log4j.core.filter.Filtering |
---|
addFilter, getFilter, hasFilter, isFiltered, removeFilter |
Field Detail |
---|
protected static final Logger LOGGER
protected Node rootNode
protected PluginManager pluginManager
protected final List<ConfigurationListener> listeners
protected ConfigurationMonitor monitor
Constructor Detail |
---|
protected BaseConfiguration()
Method Detail |
---|
public void start()
start
in interface Configuration
public void stop()
stop
in interface Configuration
protected void setup()
public Object getComponent(String name)
getComponent
in interface Configuration
public void addComponent(String name, Object obj)
addComponent
in interface Configuration
protected void doConfigure()
protected PluginManager getPluginManager()
public void setName(String name)
name
- The name.public String getName()
getName
in interface Configuration
public void addListener(ConfigurationListener listener)
addListener
in interface Configuration
listener
- The ConfigurationListener to add.public void removeListener(ConfigurationListener listener)
removeListener
in interface Configuration
listener
- The ConfigurationListener to remove.public Appender getAppender(String name)
name
- The name of the Appender.
public Map<String,Appender> getAppenders()
getAppenders
in interface Configuration
public void addAppender(Appender appender)
appender
- The Appender to add.public StrSubstitutor getSubst()
getSubst
in interface Configuration
public ConfigurationMonitor getConfigurationMonitor()
getConfigurationMonitor
in interface Configuration
public void addLoggerAppender(Logger logger, Appender appender)
addLoggerAppender
in interface Configuration
logger
- The Logger the Appender will be associated with.appender
- The Appender.public void addLoggerFilter(Logger logger, Filter filter)
addLoggerFilter
in interface Configuration
logger
- The Logger the Fo;ter will be associated with.filter
- The Filter.public void setLoggerAdditive(Logger logger, boolean additive)
setLoggerAdditive
in interface Configuration
logger
- The Logger the Appender will be associated with.additive
- True if the LoggerConfig should be additive, false otherwise.public void removeAppender(String name)
name
- the name of the appender to remove.public LoggerConfig getLoggerConfig(String name)
getLoggerConfig
in interface Configuration
name
- The Logger name.
public LoggerConfig getRootLogger()
public Map<String,LoggerConfig> getLoggers()
getLoggers
in interface Configuration
public LoggerConfig getLogger(String name)
name
- The Logger name.
public void addLogger(String name, LoggerConfig loggerConfig)
name
- The name of the Logger.loggerConfig
- The LoggerConfig.public void removeLogger(String name)
name
- The name of the Logger.public void createConfiguration(Node node, LogEvent event)
createConfiguration
in interface Configuration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |