SilverStream
Application Server 3.5

com.sssw.srv.api
Interface AgiLogger


public interface AgiLogger

Implemented by a custom class for logging server events. SilverStream supplies a default logger class for logging these events, but you can replace it with your own class that implements this interface.


Method Summary
 void enableErrorLogging(boolean doEnable, String errorLogFileName)
          Enable or disable error logging.
 void enableLogging(boolean doEnable, String logFileName)
          Enable or disable standard HTTP-level logging.
 void enableTraceLogging(boolean doEnable, String traceLogFileName)
          Enable or disable trace logging.
 void errlog(AgiSession session, String msg)
          Log an error message on behalf of the specified session to an error log.
 void errlog(String msg)
          Log an error message not associated with any particular session to the error log.
 void initialize(AgiServer server)
          Initialize this logger for the specified server.
 void log(AgiHttpServletRequest request, AgiHttpServletResponse reply, int nbytes, long duration)
          Log normally a fully handled request.
 void log(String msg)
          Log a message not associated with any particular session or request to the error log (synonymous with errorlog(msg).
 void shutdown()
          Shut down the logger, closing any resources it may hold.
 void trace(AgiSession session, String msg)
          Log a tracing message to the trace log.
 void trace(String msg)
          Log a tracing message not associated with a particular session to the trace log
 

Method Detail

log

public void log(AgiHttpServletRequest request,
                AgiHttpServletResponse reply,
                int nbytes,
                long duration)
Log normally a fully handled request. The request and reply are in the standard HttpServletRequest and HttpServletReply format.

The logger must not modify the request or reply. The logger class should only extract information from the request or response; it should not change the request or response.

Parameters:
request - the HTTP request
reply - the HTTP response
nbytes - the number of bytes sent back to this client
duration - the time it took to process this request, in milliseconds

log

public void log(String msg)
Log a message not associated with any particular session or request to the error log (synonymous with errorlog(msg).
Parameters:
msg - the message to be logged

errlog

public void errlog(AgiSession session,
                   String msg)
Log an error message on behalf of the specified session to an error log.
Parameters:
session - the session logging the error
msg - the message to be logged

errlog

public void errlog(String msg)
Log an error message not associated with any particular session to the error log.
Parameters:
msg - the message to be logged

trace

public void trace(AgiSession session,
                  String msg)
Log a tracing message to the trace log.
Parameters:
session - the session logging the message
msg - the message to be logged

trace

public void trace(String msg)
Log a tracing message not associated with a particular session to the trace log
Parameters:
msg - the message to be logged

initialize

public void initialize(AgiServer server)
Initialize this logger for the specified server.

shutdown

public void shutdown()
Shut down the logger, closing any resources it may hold.

enableLogging

public void enableLogging(boolean doEnable,
                          String logFileName)
Enable or disable standard HTTP-level logging. If disabled, the log() methods should not write anything to the log. The logFileName is a parameter passed to the logger (null if disabled).

enableErrorLogging

public void enableErrorLogging(boolean doEnable,
                               String errorLogFileName)
Enable or disable error logging. If disabled, the errlog() methods should not write anything to the log. The errorLogFileName is a parameter passed to the logger (null if disabled).

enableTraceLogging

public void enableTraceLogging(boolean doEnable,
                               String traceLogFileName)
Enable or disable trace logging. If disabled, the trace() methods should not write anything to the log. The traceLogFileName is a parameter passed to the logger (null if disabled).

SilverStream
Application Server 3.5