com.cisco.services.tracing
Class SyslogTraceWriter

java.lang.Object
  extended by com.cisco.services.tracing.BaseTraceWriter
      extended by com.cisco.services.tracing.SyslogTraceWriter
All Implemented Interfaces:
TraceWriter

public final class SyslogTraceWriter
extends BaseTraceWriter

SyslogTraceWriter refines the BaseTraceWriter to allow tracing to syslog. Cisco syslog specification calls for sending low level traces to a syslog collector in the form of UDP messages. No buffering is done in this TraceWriter. The SyslogTraceWriter makes an exception to the println() method in that it places a '\0' instead of a System specified line seperator to terminate the message packet.


Constructor Summary
SyslogTraceWriter(int port, java.lang.String collector)
          Default SyslogTraceWriter with a max trace level of INFORMATIONAL
SyslogTraceWriter(int port, java.lang.String collector, int maxTraceLevel)
          SyslogTraceWriter with max trace level specified
SyslogTraceWriter(int port, java.lang.String collector, int[] traceLevels)
          SyslogTraceWriter which takes an array of trace levels.
 
Method Summary
 void doClose()
          Closes the socket
protected  void doPrintln(java.lang.String message, int messageNumber)
          The SyslogTraceWriter makes an exception to the println() method in that it places a '\0' instead of a System specified line seperator to terminate the message packet.
static void main(java.lang.String[] args)
           
 
Methods inherited from class com.cisco.services.tracing.BaseTraceWriter
close, doFlush, flush, getDescription, getEnabled, getName, getTraceLevels, println, setTraceLevels, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SyslogTraceWriter

public SyslogTraceWriter(int port,
                         java.lang.String collector)
Default SyslogTraceWriter with a max trace level of INFORMATIONAL

See Also:
Trace

SyslogTraceWriter

public SyslogTraceWriter(int port,
                         java.lang.String collector,
                         int maxTraceLevel)
SyslogTraceWriter with max trace level specified

See Also:
Trace

SyslogTraceWriter

public SyslogTraceWriter(int port,
                         java.lang.String collector,
                         int[] traceLevels)
SyslogTraceWriter which takes an array of trace levels.

See Also:
Trace
Method Detail

doClose

public void doClose()
Closes the socket

Overrides:
doClose in class BaseTraceWriter

doPrintln

protected void doPrintln(java.lang.String message,
                         int messageNumber)
The SyslogTraceWriter makes an exception to the println() method in that it places a '\0' instead of a System specified line seperator to terminate the message packet. The portion of the message after a '\r' or '\n' is ignored

Specified by:
doPrintln in class BaseTraceWriter

main

public static void main(java.lang.String[] args)