atg.nucleus.logging
Class DispatchLogger

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.logging.DispatchLogger
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, LogListener, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class DispatchLogger
extends GenericService
implements LogListener

This log listener sorts LogEvents by type and sends them to respective log listeners.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  LogListener[] mDefaultDestinations
          The default listeners for events that do not match any classes
protected  java.lang.Class[] mLogEventClasses
          The list of log event class names to sort by.
protected  LogListener[] mSortListeners
          The list of respective log listeners to dispatch to.
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
DispatchLogger()
          Constructs a DispatchLogger.
 
Method Summary
 void doStartService()
          This is called after the service has been created, added to the Registry, and configured.
 void doStopService()
          This is called when the service is to be stopped.
 LogListener[] getDefaultDestinations()
          Returns the list of destinations to which log events should be sent if they do not match any of the specified classes.
 LogListener[] getLogDestinations()
          Returns log listeners to dispatch log events to.
 void logEvent(LogEvent pLogEvent)
          Writes the given log event out to the log file.
 void setDefaultDestinations(LogListener[] pDefaultDestinations)
          Sets the list of destinations to which log events should be sent if they do not match any of the specified classes.
 void setLogDestinations(LogListener[] pLogListeners)
          Sets the list of log listeners to dispatch log events to.
 void setLogEvents(java.lang.String[] pLogEventClassNames)
          Sets the list of log event class names to sort by.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mLogEventClasses

protected java.lang.Class[] mLogEventClasses
The list of log event class names to sort by.


mSortListeners

protected LogListener[] mSortListeners
The list of respective log listeners to dispatch to.


mDefaultDestinations

protected LogListener[] mDefaultDestinations
The default listeners for events that do not match any classes

Constructor Detail

DispatchLogger

public DispatchLogger()
Constructs a DispatchLogger.

Method Detail

setLogEvents

public void setLogEvents(java.lang.String[] pLogEventClassNames)
Sets the list of log event class names to sort by. Their order indicates in what order they will be sorted.


setLogDestinations

public void setLogDestinations(LogListener[] pLogListeners)
Sets the list of log listeners to dispatch log events to. This list must be respective of the log event class name sorting list.


getLogDestinations

public LogListener[] getLogDestinations()
Returns log listeners to dispatch log events to. This list must be respective of the log event class name sorting list.

Returns:
list of log listeners to dispatch events to

getDefaultDestinations

public LogListener[] getDefaultDestinations()
Returns the list of destinations to which log events should be sent if they do not match any of the specified classes.


setDefaultDestinations

public void setDefaultDestinations(LogListener[] pDefaultDestinations)
Sets the list of destinations to which log events should be sent if they do not match any of the specified classes.


doStartService

public void doStartService()
                    throws ServiceException
This is called after the service has been created, added to the Registry, and configured. This method should start any processes required to run the service.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if an error occurred during the operation

doStopService

public void doStopService()
                   throws ServiceException
This is called when the service is to be stopped. The service should stop any processes that it started, basically performing the opposite function as startService(). The service should also release any resources it has. After this method is called, Nucleus may choose to discard the service.

Overrides:
doStopService in class GenericService
Throws:
ServiceException - if an error occurred during the operation

logEvent

public void logEvent(LogEvent pLogEvent)
Writes the given log event out to the log file.

Specified by:
logEvent in interface LogListener
Parameters:
pLogEvent - the log event