com.bristle.javalib.log
Class ServletContextLoggerTarget

java.lang.Object
  extended by com.bristle.javalib.log.ServletContextLoggerTarget
All Implemented Interfaces:
Logger.LoggerTarget

public class ServletContextLoggerTarget
extends Object
implements Logger.LoggerTarget

This class implements the Logger.LoggerTarget interface, writing log entries to a ServletContext (Web server log file).

Usage:
   - See the Logger class.
Assumptions:
Effects:
   - Writes log entries to the specified ServletContext.
Anticipated Changes:
Notes:
Implementation Notes:
Portability Issues:
Revision History:
   $Log$


Nested Class Summary
static class ServletContextLoggerTarget.Tester
          Each class contains a Tester inner class with a main() for easier unit testing.
 
Constructor Summary
ServletContextLoggerTarget(ServletContext context)
          Constructor.
 
Method Summary
 ServletContext getServletContext()
          Get the ServletContext that messages are currently being logged to.
 void log(Logger.Entry entry)
          Log the log entry to the ServletContext.
 void setServletContext(ServletContext context)
          Set the ServletContext to write log entries to.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletContextLoggerTarget

public ServletContextLoggerTarget(ServletContext context)
Constructor.

Parameters:
context - The ServletContext to write log entries to.
Method Detail

setServletContext

public void setServletContext(ServletContext context)
Set the ServletContext to write log entries to. If null, no logging to a ServletContext is performed.

Parameters:
context - The new ServletContext.

getServletContext

public ServletContext getServletContext()
Get the ServletContext that messages are currently being logged to.

Returns:
The ServletContext.

log

public void log(Logger.Entry entry)
Log the log entry to the ServletContext.

Specified by:
log in interface Logger.LoggerTarget
Parameters:
entry - The log entry to write to the log.