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 void
static void
static void
static void
configureAndWatch
(String fileName) static void
configureAndWatch
(String fileName, long delay) void
doConfigure
(InputStream inputStream, LoggerRepository repository) void
doConfigure
(Reader reader, LoggerRepository repository) void
doConfigure
(String fileName, LoggerRepository repository) void
doConfigure
(URL url, LoggerRepository repository) private void
doConfigure
(ConfigurationSource source) void
doConfigure
(Element element, LoggerRepository repository) static Object
parseElement
(Element element, Properties props, Class expectedClass) static void
setParameter
(Element elem, PropertySetter propSetter, Properties props) static String
subst
(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
-