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.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
org.apache.log4j.spi.Configurator
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
catFactory |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
No argument constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A static version of
doConfigure(URL, LoggerRepository) . | |||||||||||
A static version of
doConfigure(String, LoggerRepository) . | |||||||||||
Configure log4j using a
configuration element as
defined in the log4j.dtd. | |||||||||||
Like
configureAndWatch(String, long) except that the
default delay as defined by DEFAULT_DELAY is
used. | |||||||||||
Read the configuration file
configFilename if it
exists. | |||||||||||
Configure log4j by reading in a log4j.dtd compliant XML
configuration file.
| |||||||||||
Interpret a resource pointed by a URL and set up log4j accordingly.
| |||||||||||
Configure log4j by reading in a log4j.dtd compliant XML
configuration file.
| |||||||||||
Configure by taking in an DOM element.
| |||||||||||
Creates an object and processes any nested param elements
but does not call activateOptions.
| |||||||||||
Sets a parameter based from configuration file content.
| |||||||||||
Substitutes property value for any references in expression.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Configure log4j by reading in a log4j.dtd compliant XML
configuration file.
| |||||||||||
Used internally to parse appenders by IDREF name.
| |||||||||||
Used internally to parse appenders by IDREF element.
| |||||||||||
Used internally to configure the log4j framework by parsing a DOM
tree of XML elements based on log4j.dtd.
| |||||||||||
Used internally to parse an appender element.
| |||||||||||
Used internally to parse an category element.
| |||||||||||
Used internally to parse the category factory element.
| |||||||||||
Used internally to parse the children of a category element.
| |||||||||||
Used internally to parse an
ErrorHandler element. | |||||||||||
Used internally to parse a filter element.
| |||||||||||
Used internally to parse a layout element.
| |||||||||||
Used internally to parse a level element.
| |||||||||||
Used internally to parse the roor category element.
| |||||||||||
Parses throwable renderer.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.log4j.spi.Configurator
|
No argument constructor.
A static version of doConfigure(URL, LoggerRepository)
.
FactoryConfigurationError |
---|
A static version of doConfigure(String, LoggerRepository)
.
FactoryConfigurationError |
---|
Configure log4j using a configuration
element as
defined in the log4j.dtd.
Like configureAndWatch(String, long)
except that the
default delay as defined by DEFAULT_DELAY
is
used.
configFilename | A log4j configuration file in XML format. |
---|
Read the configuration file 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. |
Configure log4j by reading in a log4j.dtd compliant XML configuration file.
FactoryConfigurationError |
---|
Interpret a resource pointed by a URL and set up log4j accordingly.
The configuration is done relative to the hierarchy
parameter.
url | The URL to parse |
---|---|
repository | The hierarchy to operation upon. |
Configure log4j by reading in a log4j.dtd compliant XML configuration file.
FactoryConfigurationError |
---|
Configure by taking in an DOM element.
Creates an object and processes any nested param elements but does not call activateOptions. If the class also supports UnrecognizedElementParser, the parseUnrecognizedElement method will be call for any child elements other than param.
element | element, may not be null. |
---|---|
props | properties |
expectedClass | interface or class expected to be implemented by created class |
Exception | thrown if the contain object should be abandoned. |
---|
Sets a parameter based from configuration file content.
elem | param element, may not be null. |
---|---|
propSetter | property setter, may not be null. |
props | properties |
Substitutes property value for any references in expression.
value | value from configuration file, may contain literal text, property references or both |
---|---|
props | properties. |
Configure log4j by reading in a log4j.dtd compliant XML configuration file.
FactoryConfigurationError |
---|
Used internally to parse appenders by IDREF name.
Used internally to parse appenders by IDREF element.
Used internally to configure the log4j framework by parsing a DOM tree of XML elements based on log4j.dtd.
Used internally to parse an appender element.
Used internally to parse an category element.
Used internally to parse the category factory element.
Used internally to parse the children of a category element.
Used internally to parse an ErrorHandler
element.
Used internally to parse a filter element.
Used internally to parse a level element.
Used internally to parse the roor category element.
Parses throwable renderer.
element | throwableRenderer element. |
---|