Package org.apache.log4j.xml
Class XmlConfiguration
- All Implemented Interfaces:
Configuration,Reconfigurable,Filterable,LifeCycle,LifeCycle2
Class Description goes here.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
AbstractFilterable.Builder<B extends AbstractFilterable.Builder<B>>Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longprotected static final StringFile name prefix for standard configurations.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final StringFile name prefix for test configurations.static final StringFields inherited from class org.apache.log4j.config.Log4j1Configuration
APPENDER_REF_TAG, DEFAULT_LEVEL, INHERITED, manager, MONITOR_INTERVAL, NULL, THRESHOLD_PARAMFields inherited from class org.apache.logging.log4j.core.config.AbstractConfiguration
isShutdownHookEnabled, listeners, pluginManager, pluginPackages, rootNode, scriptManager, shutdownTimeoutMillisFields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNITFields inherited from interface org.apache.logging.log4j.core.config.Configuration
CONTEXT_PROPERTIES -
Constructor Summary
ConstructorsConstructorDescriptionXmlConfiguration(LoggerContext loggerContext, ConfigurationSource source, int monitorIntervalSeconds) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAppenderIfAbsent(Appender appender) voidaddFilter(AtomicReference<Filter> ref, Element filterElement) Used internally to parse a filter element.voidConfigures log4j by reading in a log4j.dtd compliant XML configuration file.findAppenderByReference(Element appenderRef) Used internally to parse appenders by IDREF element.static voidforEachElement(NodeList list, Consumer<Element> consumer) parseAppender(Element appenderElement) Used internally to parse an appender element.parseElement(Element element, Properties props, Class expectedClass) Creates an object and processes any nested param elements but does not call activateOptions.parseFilters(Element filterElement) Used internally to parse a filter element.parseLayout(Element layoutElement) Used internally to parse a layout element.parseRewritePolicy(Element rewritePolicyElement) parseTriggeringPolicy(Element policyElement) voidsetParameter(Element elem, PropertySetter propSetter, Properties props) Sets a parameter based from configuration file content.subst(String value, Properties props) Substitutes property value for any references in expression.Methods inherited from class org.apache.log4j.config.Log4j1Configuration
getBuilderManager, initializeMethods inherited from class org.apache.logging.log4j.core.config.AbstractConfiguration
addAppender, addComponent, addListener, addLogger, addLoggerAppender, addLoggerFilter, createAdvertiser, createConfiguration, createPluginObject, getAdvertiser, getAppender, getAppenders, getAsyncLoggerConfigDelegate, getAsyncWaitStrategyFactory, getComponent, getConfigurationSource, getConfigurationStrSubstitutor, getCustomLevels, getDefaultLevel, 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, toByteArrayMethods inherited from class org.apache.logging.log4j.core.filter.AbstractFilterable
addFilter, getFilter, getPropertyArray, hasFilter, isFiltered, removeFilter, stopMethods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.logging.log4j.core.filter.Filterable
addFilter, getFilter, hasFilter, isFiltered, removeFilter
-
Field Details
-
PARAM_TAG
- See Also:
-
LAYOUT_TAG
- See Also:
-
NAME_ATTR
- See Also:
-
VALUE_ATTR
- See Also:
-
FILTER_TAG
- See Also:
-
REF_ATTR
- See Also:
-
DEFAULT_DELAY
public static final long DEFAULT_DELAY- See Also:
-
TEST_PREFIX
File name prefix for test configurations.- See Also:
-
DEFAULT_PREFIX
File name prefix for standard configurations.- See Also:
-
-
Constructor Details
-
XmlConfiguration
public XmlConfiguration(LoggerContext loggerContext, ConfigurationSource source, int monitorIntervalSeconds)
-
-
Method Details
-
addAppenderIfAbsent
-
doConfigure
Configures log4j by reading in a log4j.dtd compliant XML configuration file.- Overrides:
doConfigurein classAbstractConfiguration- Throws:
FactoryConfigurationError
-
reconfigure
- Specified by:
reconfigurein interfaceReconfigurable- Overrides:
reconfigurein classLog4j1Configuration
-
subst
Substitutes property value for any references in expression.- Parameters:
value- value from configuration file, may contain literal text, property references or bothprops- properties.- Returns:
- evaluated expression, may still contain expressions if unable to expand.
-
setParameter
Sets a parameter based from configuration file content.- Parameters:
elem- param element, may not be null.propSetter- property setter, may not be null.props- properties- Since:
- 1.2.15
-
parseElement
Creates an object and processes any nested param elements but does not call activateOptions. If the class also supports UnrecognizedElementParser, the parseUnrecognizedElement method will be call for any child elements other than param.- Parameters:
element- element, may not be null.props- propertiesexpectedClass- interface or class expected to be implemented by created class- Returns:
- created class or null.
- Throws:
Exception- thrown if the contain object should be abandoned.- Since:
- 1.2.15
-
findAppenderByReference
Used internally to parse appenders by IDREF element. -
parseAppender
Used internally to parse an appender element. -
parseRewritePolicy
-
addFilter
Used internally to parse a filter element. -
parseFilters
Used internally to parse a filter element. -
parseLayout
Used internally to parse a layout element. -
parseTriggeringPolicy
-
forEachElement
-