public class XmlConfiguration extends Log4j1Configuration
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_DELAY |
protected static String |
DEFAULT_PREFIX
File name prefix for standard configurations.
|
static String |
FILTER_TAG |
static String |
LAYOUT_TAG |
static String |
NAME_ATTR |
static String |
PARAM_TAG |
static String |
REF_ATTR |
protected static String |
TEST_PREFIX
File name prefix for test configurations.
|
static String |
VALUE_ATTR |
APPENDER_REF_TAG, INHERITED, manager, MONITOR_INTERVAL, NULL, THRESHOLD_PARAM
isShutdownHookEnabled, listeners, pluginManager, pluginPackages, rootNode, scriptManager, shutdownTimeoutMillis
Constructor and Description |
---|
XmlConfiguration(org.apache.logging.log4j.core.LoggerContext loggerContext,
org.apache.logging.log4j.core.config.ConfigurationSource source,
int monitorIntervalSeconds) |
Modifier and Type | Method and Description |
---|---|
void |
addAppenderIfAbsent(Appender appender) |
void |
doConfigure()
Configures log4j by reading in a log4j.dtd compliant XML
configuration file.
|
Appender |
findAppenderByReference(Element appenderRef)
Used internally to parse appenders by IDREF element.
|
static void |
forEachElement(NodeList list,
Consumer<Element> consumer) |
Appender |
parseAppender(Element appenderElement)
Used internally to parse an appender element.
|
Object |
parseElement(Element element,
Properties props,
Class expectedClass)
Creates an object and processes any nested param elements
but does not call activateOptions.
|
Filter |
parseFilters(Element filterElement)
Used internally to parse a filter element.
|
Layout |
parseLayout(Element layoutElement)
Used internally to parse a layout element.
|
RewritePolicy |
parseRewritePolicy(Element rewritePolicyElement) |
org.apache.logging.log4j.core.config.Configuration |
reconfigure() |
void |
setParameter(Element elem,
PropertySetter propSetter,
Properties props)
Sets a parameter based from configuration file content.
|
String |
subst(String value,
Properties props)
Substitutes property value for any references in expression.
|
getBuilderManager, initialize
addAppender, addComponent, addListener, addLogger, addLoggerAppender, addLoggerFilter, createAdvertiser, createConfiguration, createPluginObject, getAdvertiser, getAppender, getAppenders, getAsyncLoggerConfigDelegate, getComponent, getConfigurationSource, getConfigurationStrSubstitutor, getCustomLevels, getDefaultStatus, getLogger, getLoggerConfig, getLoggerContext, getLoggers, getName, getNanoClock, getPluginManager, getPluginPackages, getProperties, getReliabilityStrategy, getRootLogger, getRootNode, getScheduler, getScriptManager, getShutdownTimeoutMillis, getStrSubstitutor, getWatchManager, initializeWatchers, isShutdownHookEnabled, preConfigure, processConditionals, processSelect, removeAppender, removeListener, removeLogger, setAdvertiser, setLoggerAdditive, setName, setNanoClock, setPluginManager, setScriptManager, setToDefault, setup, start, stop, toByteArray
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stop
equalsImpl, getState, getStatusLogger, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final String PARAM_TAG
public static final String LAYOUT_TAG
public static final String NAME_ATTR
public static final String VALUE_ATTR
public static final String FILTER_TAG
public static final String REF_ATTR
public static final long DEFAULT_DELAY
protected static final String TEST_PREFIX
protected static final String DEFAULT_PREFIX
public XmlConfiguration(org.apache.logging.log4j.core.LoggerContext loggerContext, org.apache.logging.log4j.core.config.ConfigurationSource source, int monitorIntervalSeconds)
public void addAppenderIfAbsent(Appender appender)
public void doConfigure() throws FactoryConfigurationError
doConfigure
in class org.apache.logging.log4j.core.config.AbstractConfiguration
FactoryConfigurationError
public org.apache.logging.log4j.core.config.Configuration reconfigure()
reconfigure
in interface org.apache.logging.log4j.core.config.Reconfigurable
reconfigure
in class Log4j1Configuration
public String subst(String value, Properties props)
value
- value from configuration file, may contain
literal text, property references or bothprops
- properties.public void setParameter(Element elem, PropertySetter propSetter, Properties props)
elem
- param element, may not be null.propSetter
- property setter, may not be null.props
- propertiespublic Object parseElement(Element element, Properties props, Class expectedClass) throws Exception
element
- element, may not be null.props
- propertiesexpectedClass
- interface or class expected to be implemented
by created classException
- thrown if the contain object should be abandoned.public Appender findAppenderByReference(Element appenderRef)
public Appender parseAppender(Element appenderElement)
public RewritePolicy parseRewritePolicy(Element rewritePolicyElement)
public Filter parseFilters(Element filterElement)
public Layout parseLayout(Element layoutElement)
public static void forEachElement(NodeList list, Consumer<Element> consumer)
Copyright © 1999-1969 The 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.