Class XmlConfiguration

All Implemented Interfaces:
Configuration, Reconfigurable, Filterable, LifeCycle, LifeCycle2

public class XmlConfiguration extends Log4j1Configuration
Class Description goes here.
  • Field Details

  • Constructor Details

  • Method Details

    • addAppenderIfAbsent

      public void addAppenderIfAbsent(Appender appender)
    • doConfigure

      public void doConfigure() throws FactoryConfigurationError
      Configures log4j by reading in a log4j.dtd compliant XML configuration file.
      Overrides:
      doConfigure in class AbstractConfiguration
      Throws:
      FactoryConfigurationError
    • reconfigure

      public Configuration reconfigure()
      Specified by:
      reconfigure in interface Reconfigurable
      Overrides:
      reconfigure in class Log4j1Configuration
    • subst

      public String subst(String value, Properties props)
      Substitutes property value for any references in expression.
      Parameters:
      value - value from configuration file, may contain literal text, property references or both
      props - properties.
      Returns:
      evaluated expression, may still contain expressions if unable to expand.
    • setParameter

      public void setParameter(Element elem, PropertySetter propSetter, Properties props)
      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

      public Object parseElement(Element element, Properties props, Class expectedClass) throws Exception
      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 - properties
      expectedClass - 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

      public Appender findAppenderByReference(Element appenderRef)
      Used internally to parse appenders by IDREF element.
    • parseAppender

      public Appender parseAppender(Element appenderElement)
      Used internally to parse an appender element.
    • parseRewritePolicy

      public RewritePolicy parseRewritePolicy(Element rewritePolicyElement)
    • addFilter

      public void addFilter(AtomicReference<Filter> ref, Element filterElement)
      Used internally to parse a filter element.
    • parseFilters

      public Filter parseFilters(Element filterElement)
      Used internally to parse a filter element.
    • parseLayout

      public Layout parseLayout(Element layoutElement)
      Used internally to parse a layout element.
    • parseTriggeringPolicy

      public TriggeringPolicy parseTriggeringPolicy(Element policyElement)
    • forEachElement

      public static void forEachElement(NodeList list, Consumer<Element> consumer)