com.edustructures.sifworks.log
Class ServerLog

java.lang.Object
  extended by com.edustructures.sifworks.log.ServerLog

public class ServerLog
extends java.lang.Object

Provides access to the Zone Integration Server log.

ServerLog functionality can be customized and extended by adding one or more ServerLogModule implementations to the chain of loggers. The logging chain is hierarchical, comprised of ServerLog instances at the ADK, Agent, and Zone levels. Whenever a server-side logging operation is performed on a zone, it is delegated to the ServerLogModule instances at each level in the hierarchy, beginning with the Zone.

To customize server-side logging on a global basis, call the ADK.getServerLog static function and use the methods below to manipulate ServerLogModule instances at the root level of the hierarchy:

* Similarly, to customize logging on an agent-global basis or per-zone basis, call the Agent.getServerLog or Agent.getServerLog( Zone ) methods to obtain the ServerLog for the Agent or a Zone, respectively.


Method Summary
 void addLogger(ServerLogModule logger)
          Adda a ServerLogModule to the chain of loggers.
 void clearLoggers()
          Clear all ServerLogModule modules from the chain of loggers.
 java.lang.String getID()
          Returns the ID of this logger instance
static ServerLog getInstance(java.lang.String id, Zone zone)
          Get a ServerLog instance with the specified ID.
 ServerLogModule[] getLoggers()
          Get a list of all registered ServerLogModule modules that comprise the chain of loggers.
 void log(LogLevel level, java.lang.String message, SIFMessageInfo info, SIFDataObject[] objects)
          Post a SIF_LogEntry to the server.
 void log(LogLevel level, java.lang.String desc, java.lang.String extDesc, java.lang.String appCode)
          Post a SIF_LogEntry to the server.
 void log(LogLevel level, java.lang.String desc, java.lang.String extDesc, java.lang.String appCode, int category, int code)
          Post a SIF_LogEntry to the server.
 void log(LogLevel level, java.lang.String desc, java.lang.String extDesc, java.lang.String appCode, int category, int code, SIFMessageInfo info, SIFDataObject... objects)
          Post a SIF_LogEntry to the server.
 void log(LogLevel level, java.lang.String desc, java.lang.String extDesc, java.lang.String appCode, SIFMessageInfo info, SIFDataObject[] objects)
          Post a SIF_LogEntry to the server.
 void log(java.lang.String message)
          Post a SIF_LogEntry to the server.
 void removeLogger(ServerLogModule logger)
          Remove a ServerLogModule from the chain of loggers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getID

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

Returns:
the ID of this logger instance

getInstance

public static ServerLog getInstance(java.lang.String id,
                                    Zone zone)
Get a ServerLog instance with the specified ID.

This method is intended to be called internally by the ADK. You should call the ADK.getServerLog, Agent.getServerLog, or Zone.getServerLog methods to obtain a ServerLog instance rather than directly calling this method.

Parameters:
id - The ID identifying the ServerLog to return
zone - The zone that the ServerLog is attached to
Returns:
A ServerLog instance

addLogger

public void addLogger(ServerLogModule logger)
Adda a ServerLogModule to the chain of loggers.

Parameters:
logger - A ServerLogModule implementation
Since:
ADK 1.5
See Also:
removeLogger(com.edustructures.sifworks.log.ServerLogModule), clearLoggers(), getLoggers()

removeLogger

public void removeLogger(ServerLogModule logger)
Remove a ServerLogModule from the chain of loggers.

Parameters:
logger - A ServerLogModule implementation
Since:
ADK 1.5
See Also:
addLogger(com.edustructures.sifworks.log.ServerLogModule), clearLoggers(), getLoggers()

clearLoggers

public void clearLoggers()
Clear all ServerLogModule modules from the chain of loggers.

Since:
ADK 1.5
See Also:
addLogger(com.edustructures.sifworks.log.ServerLogModule), removeLogger(com.edustructures.sifworks.log.ServerLogModule), getLoggers()

getLoggers

public ServerLogModule[] getLoggers()
Get a list of all registered ServerLogModule modules that comprise the chain of loggers.

Returns:
An array of ServerLogModules
Since:
ADK 1.5
See Also:
addLogger(com.edustructures.sifworks.log.ServerLogModule), removeLogger(com.edustructures.sifworks.log.ServerLogModule), clearLoggers()

log

public void log(java.lang.String message)
Post a SIF_LogEntry to the server.

Use this form of the log method to post a simple informative message to the server.

Parameters:
message - A textual description of the error

log

public void log(LogLevel level,
                java.lang.String desc,
                java.lang.String extDesc,
                java.lang.String appCode)
Post a SIF_LogEntry to the server.

Use this form of the log method to post an error, warning, or informative message to the server with an description, extended description, and optional application-defined error code.

Parameters:
level - The LogLevel to assign to this log entry
desc - A textual description of the error
extDesc - Extended error description, or null if no value is to be assigned to the SIF_LogEntry/SIF_ExtDesc element
appCode - Error code specific to the application posting the log entry, or null if no value is to be assigned to the SIF_LogEntry/SIF_ApplicationCode element

log

public void log(LogLevel level,
                java.lang.String desc,
                java.lang.String extDesc,
                java.lang.String appCode,
                int category,
                int code)
Post a SIF_LogEntry to the server.

Use this form of the log method to post an error, warning, or informative message to the server with an category and code enumerated by the SIF Specification.

Parameters:
level - The LogLevel to assign to this log entry
desc - A textual description of the error
extDesc - Extended error description, or null if no value is to be assigned to the SIF_LogEntry/SIF_ExtDesc element
appCode - Error code specific to the application posting the log entry, or null if no value is to be assigned to the SIF_LogEntry/SIF_ApplicationCode element
category - The SIF_Category value to assign to this log entry, as defined by the SIF Specification
code - The SIF_Code value to assign to this log entry, as defined by the SIF Specification

log

public void log(LogLevel level,
                java.lang.String message,
                SIFMessageInfo info,
                SIFDataObject[] objects)
Post a SIF_LogEntry to the server.

Use this form of the log method to post a simple error, warning, or informative message to the server that references a SIF Message and optionally a set of SIF Data Objects previously received by the agent.

Parameters:
level - The LogLevel to assign to this log entry
message - A textual description of the error
info - The SIFMessageInfo instance from the ADK message handler implementation identifying a SIF Message received by the agent
objects - One or more SIFDataObject instances received in the message identified by the info parameter

log

public void log(LogLevel level,
                java.lang.String desc,
                java.lang.String extDesc,
                java.lang.String appCode,
                SIFMessageInfo info,
                SIFDataObject[] objects)
Post a SIF_LogEntry to the server.

Use this form of the log method to post an error, warning, or informative message to the server that references a SIF Message and optionally a set of SIF Data Objects previously received by the agent. The log entry can also have an extended error description and application-defined error code.

Parameters:
level - The LogLevel to assign to this log entry
desc - A textual description of the error
extDesc - Extended error description, or null if no value is to be assigned to the SIF_LogEntry/SIF_ExtDesc element
appCode - Error code specific to the application posting the log entry, or null if no value is to be assigned to the SIF_LogEntry/SIF_ApplicationCode element
info - The SIFMessageInfo instance from the ADK message handler implementation identifying a SIF Message received by the agent
objects - One or more SIFDataObject instances received in the message identified by the info parameter

log

public void log(LogLevel level,
                java.lang.String desc,
                java.lang.String extDesc,
                java.lang.String appCode,
                int category,
                int code,
                SIFMessageInfo info,
                SIFDataObject... objects)
Post a SIF_LogEntry to the server.

Use this form of the log method to post an error, warning, or informative message to the server that references a SIF Message and optionally a set of SIF Data Objects previously received by the agent. The log entry is assigned a category and code defined by the SIF Specification, and may have an extended error description and optional application-defined error code.

Parameters:
level - The LogLevel to assign to this log entry
desc - A textual description of the error
extDesc - Extended error description, or null if no value is to be assigned to the SIF_LogEntry/SIF_ExtDesc element
appCode - Error code specific to the application posting the log entry, or null if no value is to be assigned to the SIF_LogEntry/SIF_ApplicationCode element
category - The SIF_Category value to assign to this log entry, as defined by the SIF Specification
code - The SIF_Code value to assign to this log entry, as defined by the SIF Specification
info - The SIFMessageInfo instance from the ADK message handler implementation identifying a SIF Message received by the agent
objects - One or more SIFDataObject instances received in the message identified by the info parameter. This argument may be specified as an array or sequence of SIFDataObjects


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.