public class DOMConfigurator extends Object
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.
Constructor and Description |
---|
DOMConfigurator() |
Modifier and Type | Method and Description |
---|---|
static void |
configure(Element element) |
static void |
configure(String fileName) |
static void |
configure(URL url) |
static void |
configureAndWatch(String fileName) |
static void |
configureAndWatch(String fileName,
long delay) |
void |
doConfigure(Element element,
LoggerRepository repository) |
void |
doConfigure(InputStream inputStream,
LoggerRepository repository) |
void |
doConfigure(Reader reader,
LoggerRepository repository) |
void |
doConfigure(String fileName,
LoggerRepository repository) |
void |
doConfigure(URL url,
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) |
public static void configure(Element element)
public static void configure(String fileName) throws FactoryConfigurationError
FactoryConfigurationError
public static void configure(URL url) throws FactoryConfigurationError
FactoryConfigurationError
public static void configureAndWatch(String fileName)
public static void configureAndWatch(String fileName, long delay)
public static Object parseElement(Element element, Properties props, Class expectedClass)
public static void setParameter(Element elem, PropertySetter propSetter, Properties props)
public static String subst(String value, Properties props)
public void doConfigure(Element element, LoggerRepository repository)
public void doConfigure(InputStream inputStream, LoggerRepository repository) throws FactoryConfigurationError
FactoryConfigurationError
public void doConfigure(Reader reader, LoggerRepository repository) throws FactoryConfigurationError
FactoryConfigurationError
public void doConfigure(String fileName, LoggerRepository repository)
public void doConfigure(URL url, LoggerRepository repository)
Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.