public class DOMConfigurator extends Object implements org.apache.log4j.spi.Configurator
| Constructor and Description |
|---|
DOMConfigurator()
No argument constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
configure(Element element)
Configure log4j using a
configuration element as defined in the
log4j.dtd. |
static void |
configure(String filename)
A static version of
doConfigure(String, LoggerRepository). |
static void |
configure(URL url)
A static version of
doConfigure(URL, LoggerRepository). |
static void |
configureAndWatch(String configFilename)
Like
configureAndWatch(String, long) except that the default delay
as defined by FileWatchdog.DEFAULT_DELAY is used. |
static void |
configureAndWatch(String configFilename,
long delay)
Read the configuration file
configFilename if it exists. |
void |
doConfigure(Element element,
org.apache.log4j.spi.LoggerRepository repository)
Configure by taking in an DOM element.
|
void |
doConfigure(InputStream inputStream,
org.apache.log4j.spi.LoggerRepository repository)
Configure log4j by reading in a log4j.dtd compliant XML configuration file.
|
void |
doConfigure(Reader reader,
org.apache.log4j.spi.LoggerRepository repository)
Configure log4j by reading in a log4j.dtd compliant XML configuration file.
|
void |
doConfigure(String filename,
org.apache.log4j.spi.LoggerRepository repository) |
void |
doConfigure(URL url,
org.apache.log4j.spi.LoggerRepository repository) |
static Object |
parseElement(Element element,
Properties props,
Class expectedClass)
Creates an object and processes any nested param elements but does not call
activateOptions.
|
static void |
setParameter(Element elem,
org.apache.log4j.config.PropertySetter propSetter,
Properties props)
Sets a parameter based from configuration file content.
|
static String |
subst(String value,
Properties props)
Substitutes property value for any references in expression.
|
public static void configure(Element element)
configuration element as defined in the
log4j.dtd.public static void configureAndWatch(String configFilename)
configureAndWatch(String, long) except that the default delay
as defined by FileWatchdog.DEFAULT_DELAY is used.configFilename - A log4j configuration file in XML format.public static void configureAndWatch(String configFilename, long delay)
configFilename if it exists.
Moreover, a thread will be created that will periodically check if
configFilename has been created or modified. The period is
determined by the delay argument. If a change or file creation
is detected, then configFilename is read to configure log4j.configFilename - A log4j configuration file in XML format.delay - The delay in milliseconds to wait between each check.public void doConfigure(String filename, org.apache.log4j.spi.LoggerRepository repository)
public void doConfigure(URL url, org.apache.log4j.spi.LoggerRepository repository)
doConfigure in interface org.apache.log4j.spi.Configuratorpublic void doConfigure(InputStream inputStream, org.apache.log4j.spi.LoggerRepository repository) throws FactoryConfigurationError
doConfigure in interface org.apache.log4j.spi.ConfiguratorFactoryConfigurationErrorpublic void doConfigure(Reader reader, org.apache.log4j.spi.LoggerRepository repository) throws FactoryConfigurationError
FactoryConfigurationErrorpublic void doConfigure(Element element, org.apache.log4j.spi.LoggerRepository repository)
public static void configure(String filename) throws FactoryConfigurationError
doConfigure(String, LoggerRepository).FactoryConfigurationErrorpublic static void configure(URL url) throws FactoryConfigurationError
doConfigure(URL, LoggerRepository).FactoryConfigurationErrorpublic static String subst(String value, Properties props)
value - value from configuration file, may contain literal text,
property references or bothprops - properties.public static void setParameter(Element elem, org.apache.log4j.config.PropertySetter propSetter, Properties props)
elem - param element, may not be null.propSetter - property setter, may not be null.props - propertiespublic static Object parseElement(Element element, Properties props, Class expectedClass) throws Exception
element - element, may not be null.props - propertiesexpectedClass - interface or class expected to be implemented by created
classException - thrown if the contain object should be abandoned.Copyright © 2006–2022 OPS4J - Open Participation Software for Java. All rights reserved.