Main: Whitepaper FAQ Examples JavaDoc Classloader Performance
Protomatter Software v1.1.8

com.protomatter.syslog.xml
Class UNIXSyslogLog_Helper

java.lang.Object
  |
  +--com.protomatter.syslog.xml.BasicLogger_Helper
        |
        +--com.protomatter.syslog.xml.UNIXSyslogLog_Helper
All Implemented Interfaces:
XMLConfigHelper

public class UNIXSyslogLog_Helper
extends BasicLogger_Helper

XML configuration helper for UNIXSyslogLog.


Constructor Summary
UNIXSyslogLog_Helper()
           
 
Method Summary
 void configure(java.lang.Object o, org.jdom.Element e)
          Configure this logger given the XML element.
 org.jdom.Element getConfiguration(java.lang.Object o, org.jdom.Element element)
          Encode the given object's configuration into the given XML element.
 
Methods inherited from class com.protomatter.syslog.xml.BasicLogger_Helper
configure, getConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UNIXSyslogLog_Helper

public UNIXSyslogLog_Helper()
Method Detail

configure

public void configure(java.lang.Object o,
                      org.jdom.Element e)
               throws SyslogInitException
Configure this logger given the XML element. The <Logger> element should look like this:



  <Logger class="com.protomatter.syslog.UNIXSyslogLog" >

    <!--

     Note that the hostname attribute of the
     <Syslog> tag must be specified.

     Config params from BasicLogger_Helper can
     get inserted here.

     Note: The <Format/> tag is completely ignored
     because the format is dictated by the UNIX
     syslog system.
    -->

    <logServer>hostname or IP address</logServer>
    <port>port</port>
    <facility>facility-id</facility>
    <tag>tag-value</tag>
    <showHostname>true|false</showHostname>

    <messageTemplate>message-body-template</messageTemplate>

    <SeverityMap>
      <MapEntry>
        <syslog>DEBUG</syslog>
        <unix>DEBUG</unix>
      </MapEntry>
      <MapEntry>
        <syslog>INFO</syslog>
        <unix>INFO</unix>
      </MapEntry>
      <MapEntry>
        <syslog>WARNING</syslog>
        <unix>WARNING</unix>
      </MapEntry>
      <MapEntry>
        <syslog>ERROR</syslog>
        <unix>ERROR</unix>
      </MapEntry>
      <MapEntry>
        <syslog>FATAL</syslog>
        <unix>EMERGENCY</unix>
      </MapEntry>
    </SeverityMap>

  </Logger>
  

Element
name value required
logServer The hostname or IP address of the log server that packets should be sent to. yes
port The port number to send packets to on the log server. no (default is 514)
facility The UNIX syslog facility ID that messages appear from. A list can be found here. no (default is 16)
tag Text value of the packet "tag" -- the default is "ProtomatterSyslog" and is generally meant to be the application or "process" name. no (default is "ProtomatterSyslog")
showHostname true or false -- decide if we should show the hostname before the "tag". The spec says that you should do this, but when I tested under Red Hat Linux 7.2, it just ended up repeating the data. Your mileage may vary. no (default is false)
messageTemplate The template for formatting the body of the message. The following tokens are replaced in this string:

    {CHANNEL}Channel name
    {CALLER-FULLNAME}Full caller class name (with package)
    {CALLER}Caller class name
    {MESSAGE}Short message
    {THREAD}Thread name
    {SEVERITY}Severity ("DEBUG" ... "FATAL")

default is "[{SEVERITY}] {CALLER}: {MESSAGE}"

SeverityMap Contains a set of <MapEntry> elements, each containing a <syslog> and <unix> elements. Valid values for the <syslog> element are DEBUG, INFO, WARNING, ERROR and FATAL. You must specify map entries for all of the syslog severities. Each must map to a UNIX syslog severity, whose legal values are: DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL and EMERGENCY. no (default is shown above)

Overrides:
configure in class BasicLogger_Helper
Following copied from class: com.protomatter.syslog.xml.BasicLogger_Helper
See Also:
SimpleSyslogTextFormatter_Helper.configure(Object,Element), HTMLSyslogTextFormatter_Helper.configure(Object,Element), SimpleLogPolicy_Helper.configure(Object,Element), PerClassPolicy_Helper.configure(Object,Element)

getConfiguration

public org.jdom.Element getConfiguration(java.lang.Object o,
                                         org.jdom.Element element)
Description copied from interface: XMLConfigHelper
Encode the given object's configuration into the given XML element.
Overrides:
getConfiguration in class BasicLogger_Helper

Protomatter Software v1.1.8
Copyright 1998-2002 Nate Sammons

Protomatter Software v1.1.8 http://protomatter.sourceforge.net/1.1.8