Class DOMConfigurator


  • public class DOMConfigurator
    extends java.lang.Object
    Use this class to initialize the log4j environment using a DOM tree.

    The DTD is specified in log4j.dtd.

    Sometimes it is useful to see how log4j is reading configuration files. You can enable log4j internal logging by defining the log4j.debug variable on the java command line. Alternatively, set the debug attribute in the log4j:configuration element. As in

    <log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
    ...
    </log4j:configuration>
     

    There are sample XML files included in the package.

    Since:
    0.8.3
    • Constructor Detail

      • DOMConfigurator

        public DOMConfigurator()
    • Method Detail

      • configure

        public static void configure​(org.w3c.dom.Element element)
      • configure

        public static void configure​(java.lang.String fileName)
                              throws javax.xml.parsers.FactoryConfigurationError
        Throws:
        javax.xml.parsers.FactoryConfigurationError
      • configure

        public static void configure​(java.net.URL url)
                              throws javax.xml.parsers.FactoryConfigurationError
        Throws:
        javax.xml.parsers.FactoryConfigurationError
      • configureAndWatch

        public static void configureAndWatch​(java.lang.String fileName)
      • configureAndWatch

        public static void configureAndWatch​(java.lang.String fileName,
                                             long delay)
      • parseElement

        public static java.lang.Object parseElement​(org.w3c.dom.Element element,
                                                    java.util.Properties props,
                                                    java.lang.Class expectedClass)
      • setParameter

        public static void setParameter​(org.w3c.dom.Element elem,
                                        PropertySetter propSetter,
                                        java.util.Properties props)
      • subst

        public static java.lang.String subst​(java.lang.String value,
                                             java.util.Properties props)
      • doConfigure

        public void doConfigure​(org.w3c.dom.Element element,
                                LoggerRepository repository)
      • doConfigure

        public void doConfigure​(java.io.InputStream inputStream,
                                LoggerRepository repository)
                         throws javax.xml.parsers.FactoryConfigurationError
        Throws:
        javax.xml.parsers.FactoryConfigurationError
      • doConfigure

        public void doConfigure​(java.io.Reader reader,
                                LoggerRepository repository)
                         throws javax.xml.parsers.FactoryConfigurationError
        Throws:
        javax.xml.parsers.FactoryConfigurationError
      • doConfigure

        public void doConfigure​(java.lang.String fileName,
                                LoggerRepository repository)
      • doConfigure

        public void doConfigure​(java.net.URL url,
                                LoggerRepository repository)