SK.gnome.dwarf.log
Class LogServer

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.GenericServer
          extended bySK.gnome.dwarf.log.LogServer
All Implemented Interfaces:
Logger, Reportable, Server, Service

public class LogServer
extends GenericServer
implements Logger

Provides container for the logging services.

It can be used to logically group various logging services to build a more complex logging subsystem. (Note that a logging service must implement the Logger interface.) The two inherited log methods are overriden in a way that they simply pass the log requests to all logging services contained by this LogServer.

Implementation note:No logging services may be added or removed from this server instance safely while it is running.


Field Summary
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
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
LogServer(java.lang.String name)
          Creates a new LogServer.
 
Method Summary
protected  Logger getLogger()
          Returns the logging service.
 void log(java.lang.String facility, LogLevel level, java.lang.String message)
          Logs the message with the given logging level and facility.
 void log(java.lang.String facility, LogLevel level, java.lang.String message, java.lang.Throwable error)
          Logs the message and the error with the given logging level and facility.
 
Methods inherited from class SK.gnome.dwarf.GenericServer
addService, addService, getAuthenticator, getParameters, getService, getServices, getServices, init, removeService, report, shutdown, start, stop
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getName, 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
 
Methods inherited from interface SK.gnome.dwarf.Service
getFullName, getName, getState, log, log, login, logout
 

Constructor Detail

LogServer

public LogServer(java.lang.String name)
Creates a new LogServer.

Method Detail

log

public final void log(java.lang.String facility,
                      LogLevel level,
                      java.lang.String message)
Logs the message with the given logging level and facility.

Calls the log(String, LogLevel, String) method of each contained logging service with the corresponding arguments.

Specified by:
log in interface Logger
Parameters:
facility - the logging facility
level - the logging level
message - the message

log

public final void log(java.lang.String facility,
                      LogLevel level,
                      java.lang.String message,
                      java.lang.Throwable error)
Logs the message and the error with the given logging level and facility.

Calls the log(String, LogLevel, String, Throwable) method of each contained logging service with the corresponding arguments.

Specified by:
log in interface Logger
Parameters:
facility - the logging facility
level - the logging level
message - the message
error - the error

getLogger

protected Logger getLogger()
Returns the logging service.

It returns a reference to this object, because otherwise all logging requests would be diverted to the first one of the contained loggers only.

Overrides:
getLogger in class GenericServer


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.