|
|
|||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.protomatter.syslog.xml.SyslogXML
A utility class for configuring Syslog from an XML file.
Field Summary | |
static java.lang.String |
XML_PARSER_PROPERTY
The system property used to set the XML parser class. |
Method Summary | |
static boolean |
configure(org.jdom.Element syslogConfig)
Configure syslog from the given XML document. |
static void |
configure(java.io.File xmlFile)
Configure syslog from the given XML file. |
static void |
configure(java.io.File xmlFile,
java.lang.String saxDriverClass,
boolean showClassloaderWarning)
Configure syslog from the given XML file using the given JDom SAX driver class as a parser. |
static void |
configure(java.io.InputStream input)
Configure syslog from the given XML file. |
static void |
configure(java.io.InputStream input,
java.lang.String saxDriverClass,
boolean showClassloaderWarning)
Configure syslog from the given XML file using the given JDom SAX driver class as a parser. |
static org.jdom.Document |
getConfiguration()
Get an XML representation of the current configuration state of Syslog including all loggers, etc. |
static void |
main(java.lang.String[] args)
Write an example XML configuration file to standard out. |
static void |
writeConfiguration(java.io.OutputStream out)
Get an XML representation of the current configuration state of Syslog including all loggers, etc and write it to the given output stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String XML_PARSER_PROPERTY
Method Detail |
public static void writeConfiguration(java.io.OutputStream out) throws java.io.IOException
public static org.jdom.Document getConfiguration()
public static void configure(java.io.File xmlFile) throws SyslogInitException
By default, this method will use the default SAX parser to parse the configuration file using JDom. If you wish to change the parser, you can specify the "Syslog.xml.parser" system property. That property should be set to the fully qualified class name of a SAX parser, such as "org.apache.xerces.parsers.SAXParser".
configure(Element element)
public static void configure(java.io.InputStream input) throws SyslogInitException
By default, this method will use the default SAX parser to parse the configuration file using JDom. If you wish to change the parser, you can specify the "Syslog.xml.parser" system property. That property should be set to the fully qualified class name of a SAX parser, such as "org.apache.xerces.parsers.SAXParser".
configure(Element element)
public static void configure(java.io.File xmlFile, java.lang.String saxDriverClass, boolean showClassloaderWarning) throws SyslogInitException
xmlFile
- Configuration filesaxDriverClass
- XML parser class nameshowClassloaderWarning
- Should the classloader warning be shown?configure(Element element)
public static void configure(java.io.InputStream input, java.lang.String saxDriverClass, boolean showClassloaderWarning) throws SyslogInitException
input
- InputStream carrying the XML configuration datasaxDriverClass
- XML parser class nameshowClassloaderWarning
- Should the classloader warning be shown?configure(Element element)
public static boolean configure(org.jdom.Element syslogConfig) throws SyslogInitException
<Syslog defaultMask="DefaultSyslogLogMask" hostname="LocalHostName" computeCaller="true|false" alwaysComputeCaller="true|false" flushThreadInterval="milliseconds" > <Debug enabled="true|false" scan="true|false"> <name level="trace|debug|info">name1</name> <name level="trace|debug|info">pattern1</name> <name level="trace|debug|info">name2</name> <name level="trace|debug|info">pattern2</name> </Debug> <Logger name="LoggerName" class="LoggerClassName" > <!-- Logger directives --> </Logger> <!-- More loggers here --> </Syslog> |
Each logger is loaded and configured with it's Logger XML element. See the Javadoc for individual loggers for more information.
The default, system-wide log mask is set to be "at or above" the value of the defaultMask attribute (if present). The hostname that Syslog thinks is "local" is set to the value of the hostname attribute (if present).
If the flushThreadInterval attribute is set, it is interpreted as the number of milliseconds for a background thread to sleep between attempts to flush all the loggers.
The computeCaller and alwaysComputeCaller attributes correspond to the Syslog.setComputeCaller() and Syslog.setAlwaysComputeCaller() methods.
The optional <Debug> element contains a list of <name> elements, which are passed to the addXXXName() method of the com.protomatter.util.Debug class.
BasicLogger
public static final void main(java.lang.String[] args)
configure(Element element)
|
Protomatter Software v1.1.8 Copyright 1998-2002 Nate Sammons |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Protomatter Software v1.1.8 | http://protomatter.sourceforge.net/1.1.8 |