Package org.apache.log4j.xml
Class DOMConfigurator
- java.lang.Object
-
- org.apache.log4j.xml.DOMConfigurator
-
public class DOMConfigurator extends 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 thelog4j: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 Constructor Description DOMConfigurator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
configure(String fileName)
static void
configure(URL url)
static void
configure(Element element)
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)
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)
-
-
-
Method Detail
-
configure
public static void configure(Element element)
-
configure
public static void configure(String fileName) throws FactoryConfigurationError
- Throws:
FactoryConfigurationError
-
configure
public static void configure(URL url) throws FactoryConfigurationError
- Throws:
FactoryConfigurationError
-
configureAndWatch
public static void configureAndWatch(String fileName)
-
configureAndWatch
public static void configureAndWatch(String fileName, long delay)
-
parseElement
public static Object parseElement(Element element, Properties props, Class expectedClass)
-
setParameter
public static void setParameter(Element elem, PropertySetter propSetter, Properties props)
-
subst
public static String subst(String value, Properties props)
-
doConfigure
public void doConfigure(Element element, LoggerRepository repository)
-
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
public void doConfigure(String fileName, LoggerRepository repository)
-
doConfigure
public void doConfigure(URL url, LoggerRepository repository)
-
-