com.edustructures.sifworks.log
Class DefaultServerLogModule

java.lang.Object
  extended by com.edustructures.sifworks.log.DefaultServerLogModule
All Implemented Interfaces:
ServerLogModule

public class DefaultServerLogModule
extends java.lang.Object
implements ServerLogModule

The default ServerLogModule implementation for server logging. An instance of this class is installed by default when the ADK is initialized.

DefaultServerLogModule writes to the server log by constructing and reporting a SIF_LogEntry object as an Add SIF_Event when the log method is called. Because SIF_LogEntry was introduced in SIF 1.5, an event is only reported when the agent's default SIF Version is 1.5 or later. No action is taken for earlier versions.

By default, DefaultServerLogModule echos all messages to the zone's local Log4j Category. Call the setEcho method to disable this functionality. Follow these steps to obtain the DefaultServerLogModule that is installed by the ADK when it is initialized:


Constructor Summary
DefaultServerLogModule()
           
 
Method Summary
 boolean getEcho()
          Determines if SIF_LogEntry objects should be echoed to the local client-side zone log
 java.lang.String getID()
          Gets the ID of this logger
 boolean getReportEvents()
          Determines if SIF_LogEntry objects are reported to the zone.
 void log(Zone zone, SIF_LogEntry data)
          Post a SIF_LogEntry to the server.
 void log(Zone zone, java.lang.String message)
          Post a string message to the server log.
 void setEcho(boolean echo)
          Determines if SIF_LogEntry objects should be echoed to the local client-side zone log
 void setReportEvents(boolean report)
          Determines if SIF_LogEntry objects are reported to the zone.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultServerLogModule

public DefaultServerLogModule()
Method Detail

getID

public java.lang.String getID()
Gets the ID of this logger

Specified by:
getID in interface ServerLogModule
Returns:
The ID of this ServerLogModule instance

setEcho

public void setEcho(boolean echo)
Determines if SIF_LogEntry objects should be echoed to the local client-side zone log

Parameters:
echo - true to echo SIF_LogEntry information to the client-size zone log; false to disable echoing. Note that SIF_LogEntry is always echoed to the local zone log when the ADK is initialized with a version of SIF prior to 1.5.

getEcho

public boolean getEcho()
Determines if SIF_LogEntry objects should be echoed to the local client-side zone log

Returns:
true to echo SIF_LogEntry information to the client-size zone log; false to disable echoing. Note that SIF_LogEntry is always echoed to the local zone log when the ADK is initialized with a version of SIF prior to 1.5.

setReportEvents

public void setReportEvents(boolean report)
Determines if SIF_LogEntry objects are reported to the zone. This method can be called to disable SIF_LogEntry reporting to zones while continuing to allow log messages to be echoed to the local zone log.

Parameters:
report - true to report SIF_LogEntry events, false to disable reporting of events

getReportEvents

public boolean getReportEvents()
Determines if SIF_LogEntry objects are reported to the zone. This method can be called to disable SIF_LogEntry reporting to zones while continuing to allow log messages to be echoed to the local zone log.

Returns:
true to report SIF_LogEntry events, false to disable reporting of events

log

public void log(Zone zone,
                java.lang.String message)
Post a string message to the server log.

The implementation of this method constructs a SIF_LogEntry object with the LogLevel attribute set to "Info" and the SIF_Desc element set to the text message passed to the message parameter. The SIF_LogEntry object is then reported to the zone as a SIF_Event by delegating to the log method that accepts a SIF_LogEntry parameter.

Specified by:
log in interface ServerLogModule
Parameters:
zone - The zone on the server to post the message to
message - The message text

log

public void log(Zone zone,
                SIF_LogEntry data)
Post a SIF_LogEntry to the server.

Specified by:
log in interface ServerLogModule
Parameters:
zone - The Zone to post log information to
data - The SIF_LogEntry object to post as an Add Event


Copyright © 2001-2007 Edustructures LLC. All Rights Reserved. SIFWorks® and ADK® are registered trademarks of Edustructures LLC. SIF™ and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.