SK.gnome.dwarf.sample
Class SyslogHandler
java.lang.Object
SK.gnome.dwarf.GenericService
SK.gnome.dwarf.thread.ThreadService
SK.gnome.dwarf.thread.Handler
SK.gnome.dwarf.tcpip.UDPHandler
SK.gnome.dwarf.sample.SyslogHandler
- All Implemented Interfaces:
- java.lang.Runnable, Service, Stoppable
- public class SyslogHandler
- extends UDPHandler
Sample syslog handler.
This handler parses the received UDP packets in format used by the Unix syslog service,
and forwards the logging requests to the Logger.log(String, LogLevel, String)
method
of the current logging service returned from the GenericService.getLogger()
method. Thus the
remote log events are translated and diverted to the internal logging mechanism as if they
were generated directly by the application code.
The handler may be directly used to implement a syslog server, which will route the remote
log events to the Dwarf-based logging mechanism. In order to do it, it must be added to a
TCPIPServer
instance together with a UDPListener
instance.
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary |
SyslogHandler(java.lang.String name)
Creates a new SyslogHandler. |
Method Summary |
protected void |
handle(java.net.DatagramPacket packet)
Handles the UDP syslog packet. |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SyslogHandler
public SyslogHandler(java.lang.String name)
- Creates a new SyslogHandler.
handle
protected void handle(java.net.DatagramPacket packet)
- Handles the UDP syslog packet.
- Specified by:
handle
in class UDPHandler
Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.