|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Configuration
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. |
|
|
getComponent(String name)
|
|
ConfigurationMonitor |
getConfigurationMonitor()
|
|
ConfigurationSource |
getConfigurationSource()
Returns the source of this configuration. |
|
List<CustomLevelConfig> |
getCustomLevels()
Returns a list of descriptors of the custom levels defined in the current configuration. |
|
LoggerConfig |
getLoggerConfig(String name)
Locates the appropriate LoggerConfig for a Logger name. |
|
Map<String,LoggerConfig> |
getLoggers()
|
|
String |
getName()
Returns the configuration name. |
|
List<String> |
getPluginPackages()
Returns the list of packages to scan for plugins for this Configuration. |
|
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 |
---|
getState, isStarted, isStopped, start, stop |
Field Detail |
---|
static final String CONTEXT_PROPERTIES
Method Detail |
---|
String getName()
LoggerConfig getLoggerConfig(String name)
name
- The Logger name.
Appender getAppender(String name)
name
- The name of the Appender.
Map<String,Appender> getAppenders()
void addAppender(Appender appender)
Map<String,LoggerConfig> getLoggers()
void addLoggerAppender(Logger logger, Appender appender)
void addLoggerFilter(Logger logger, Filter filter)
void setLoggerAdditive(Logger logger, boolean additive)
void addLogger(String name, LoggerConfig loggerConfig)
void removeLogger(String name)
List<String> getPluginPackages()
Map<String,String> getProperties()
void addListener(ConfigurationListener listener)
void removeListener(ConfigurationListener listener)
StrSubstitutor getStrSubstitutor()
void createConfiguration(Node node, LogEvent event)
<T> T getComponent(String name)
void addComponent(String name, Object object)
void setConfigurationMonitor(ConfigurationMonitor monitor)
ConfigurationMonitor getConfigurationMonitor()
void setAdvertiser(Advertiser advertiser)
Advertiser getAdvertiser()
boolean isShutdownHookEnabled()
ConfigurationSource getConfigurationSource()
List<CustomLevelConfig> getCustomLevels()
Returns a list of descriptors of the custom levels defined in the current configuration. The returned list does
not include custom levels that are defined in code with direct calls to Level.forName(String, int)
.
Note that the list does not include levels of previous configurations. For example, suppose a configuration
contains custom levels A, B and C. The configuration is then modified to contain custom levels B, C and D. For
the new configuration, this method will return only {B, C, D}, that is, only the custom levels defined in
this configuration. The previously defined level A still exists (and can be obtained with
Level.getLevel(String)
), it is just not in the current configuration. Level.values()
will return
{A, B, C, D and the built-in levels}.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2015 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.