|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.logging.jdk.xml.DOMConfigurator
public class 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
jdk: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 Summary | |
---|---|
DOMConfigurator()
No argument constructor. |
|
DOMConfigurator(ErrorManager errorLog)
|
Method Summary | |
---|---|
static void |
configure(Element element)
Configure jdk using a configuration element as
defined in the jdk.dtd. |
static void |
configure(InputStream is)
A static version of doConfigure(java.net.URL, LogManager) . |
static void |
configure(String filename)
A static version of doConfigure(String, LogManager) . |
static void |
configure(URL url)
A static version of doConfigure(java.net.URL, LogManager) . |
protected void |
debug(String msg)
|
void |
doConfigure(Element element,
LogManager repository)
Configure by taking in an DOM element. |
protected void |
doConfigure(InputSource inputSource,
LogManager repository)
Configure jdk by reading in a jdk.dtd compliant XML configuration file. |
void |
doConfigure(InputStream inputStream,
LogManager repository)
Configure jdk by reading in a jdk.dtd compliant XML configuration file. |
void |
doConfigure(Reader reader,
LogManager repository)
Configure jdk by reading in a jdk.dtd compliant XML configuration file. |
void |
doConfigure(String filename,
LogManager repository)
|
void |
doConfigure(URL url,
LogManager repository)
|
protected Handler |
findHandlerByName(Document doc,
String appenderName)
Used internally to parse appenders by IDREF name. |
protected Handler |
findHandlerByReference(Element appenderRef)
Used internally to parse appenders by IDREF element. |
protected void |
parse(Element element)
Used internally to configure the jdk framework by parsing a DOM tree of XML elements based on jdk.dtd. |
protected void |
parseCategory(Element loggerElement)
Used internally to parse an category element. |
protected void |
parseCategoryFactory(Element factoryElement)
Used internally to parse the category factory element. |
protected void |
parseChildrenOfLoggerElement(Element catElement,
Logger logger,
boolean isRoot)
Used internally to parse the children of a category element. |
protected void |
parseErrorManager(Element element,
Handler appender)
Used internally to parse an ErrorManager element. |
protected void |
parseFilters(Element element,
Handler appender)
Used internally to parse a filter element. |
protected Handler |
parseHandler(Element appenderElement)
Used internally to parse an appender element. |
protected Formatter |
parseLayout(Element layout_element)
Used internally to parse a layout element. |
protected void |
parseLevel(Element element,
Logger logger,
boolean isRoot)
Used internally to parse a level element. |
protected void |
parseRenderer(Element element)
|
protected void |
parseRoot(Element rootElement)
Used internally to parse the root category element. |
protected void |
setParameter(Element elem,
Properties beanProps)
|
protected String |
subst(String value)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMConfigurator()
public DOMConfigurator(ErrorManager errorLog)
Method Detail |
---|
public static void configure(Element element)
configuration
element as
defined in the jdk.dtd.
element
- public static void configure(String filename) throws FactoryConfigurationError
doConfigure(String, LogManager)
.
filename
- the file name
FactoryConfigurationError
- for any errorpublic static void configure(URL url) throws FactoryConfigurationError
doConfigure(java.net.URL, LogManager)
.
url
- the url
FactoryConfigurationError
- for any errorpublic static void configure(InputStream is) throws FactoryConfigurationError
doConfigure(java.net.URL, LogManager)
.
is
- the input stream
FactoryConfigurationError
- for any errorprotected Handler findHandlerByName(Document doc, String appenderName)
doc
- the documentappenderName
- the appender name
protected Handler findHandlerByReference(Element appenderRef)
appenderRef
-
protected Handler parseHandler(Element appenderElement)
appenderElement
- the append element
protected void parseErrorManager(Element element, Handler appender) throws Exception
ErrorManager
element.
element
- the xml elementappender
- the appender
Exception
- for any errorprotected void parseFilters(Element element, Handler appender) throws Exception
element
- the xml elementappender
- the appender
Exception
- for any errorprotected void parseCategory(Element loggerElement) throws Exception
loggerElement
- the xml element
Exception
- for any errorprotected void parseCategoryFactory(Element factoryElement) throws Exception
factoryElement
- the xml element
Exception
- for any errorprotected void parseRoot(Element rootElement) throws Exception
rootElement
- the xml element
Exception
- for any errorprotected void parseChildrenOfLoggerElement(Element catElement, Logger logger, boolean isRoot) throws Exception
catElement
- the xml elementlogger
- the loggerisRoot
- whether this is the root
Exception
- for any errorprotected Formatter parseLayout(Element layout_element)
layout_element
- the xml element
protected void parseRenderer(Element element)
protected void parseLevel(Element element, Logger logger, boolean isRoot)
element
- the elementlogger
- the loggerisRoot
- whether it is the rootprotected void setParameter(Element elem, Properties beanProps)
public void doConfigure(String filename, LogManager repository)
public void doConfigure(URL url, LogManager repository)
public void doConfigure(InputStream inputStream, LogManager repository) throws FactoryConfigurationError
inputStream
- repository
-
FactoryConfigurationError
public void doConfigure(Reader reader, LogManager repository) throws FactoryConfigurationError
reader
- repository
-
FactoryConfigurationError
protected void doConfigure(InputSource inputSource, LogManager repository) throws FactoryConfigurationError
inputSource
- repository
-
FactoryConfigurationError
public void doConfigure(Element element, LogManager repository)
element
- repository
- protected void parse(Element element)
element
- protected String subst(String value)
protected void debug(String msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |