Package org.apache.log4j.xml
Class DOMConfigurator
java.lang.Object
org.apache.log4j.xml.DOMConfigurator
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidstatic voidstatic voidconfigureAndWatch(String fileName) static voidconfigureAndWatch(String fileName, long delay) voiddoConfigure(InputStream inputStream, LoggerRepository repository) voiddoConfigure(Reader reader, LoggerRepository repository) voiddoConfigure(String fileName, LoggerRepository repository) voiddoConfigure(URL url, LoggerRepository repository) private voiddoConfigure(ConfigurationSource source) voiddoConfigure(Element element, LoggerRepository repository) static ObjectparseElement(Element element, Properties props, Class expectedClass) static voidsetParameter(Element elem, PropertySetter propSetter, Properties props) static Stringsubst(String value, Properties props)
-
Constructor Details
-
DOMConfigurator
public DOMConfigurator()
-
-
Method Details
-
configure
-
configure
- Throws:
FactoryConfigurationError
-
configure
- Throws:
FactoryConfigurationError
-
configureAndWatch
-
configureAndWatch
-
parseElement
-
setParameter
-
subst
-
doConfigure
-
doConfigure
-
doConfigure
public void doConfigure(InputStream inputStream, LoggerRepository repository) throws FactoryConfigurationError - Throws:
FactoryConfigurationError
-
doConfigure
public void doConfigure(Reader reader, LoggerRepository repository) throws FactoryConfigurationError - Throws:
FactoryConfigurationError
-
doConfigure
-
doConfigure
-