org.apache.velocity.tools.view.servlet
Class ServletLogger

java.lang.Object
  extended byorg.apache.velocity.tools.view.servlet.ServletLogger
All Implemented Interfaces:
org.apache.velocity.runtime.log.LogSystem

public class ServletLogger
extends java.lang.Object
implements org.apache.velocity.runtime.log.LogSystem

Simple wrapper for the servlet log. This has Velocity log messages to ServletContext.log(String).

Version:
$Revision: 1.8.2.1 $ $Date: 2004/05/17 17:09:45 $
Author:
Geir Magnusson Jr.

Field Summary
static java.lang.String PREFIX
           
protected  javax.servlet.ServletContext servletContext
           
 
Fields inherited from interface org.apache.velocity.runtime.log.LogSystem
DEBUG_ID, DEBUG_ON, ERROR_ID, INFO_ID, WARN_ID
 
Constructor Summary
ServletLogger()
          Construct a simple logger for a servlet environment.
 
Method Summary
 void init(org.apache.velocity.runtime.RuntimeServices rs)
          init()
 void logVelocityMessage(int level, java.lang.String message)
          Send a log message from Velocity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servletContext

protected javax.servlet.ServletContext servletContext

PREFIX

public static final java.lang.String PREFIX
See Also:
Constant Field Values
Constructor Detail

ServletLogger

public ServletLogger()
Construct a simple logger for a servlet environment.
NOTE: this class expects that the ServletContext has already been placed in the runtime's application attributes under its full class name (i.e. "javax.servlet.ServletContext").

Method Detail

init

public void init(org.apache.velocity.runtime.RuntimeServices rs)
          throws java.lang.Exception
init()

Specified by:
init in interface org.apache.velocity.runtime.log.LogSystem
Throws:
java.lang.IllegalStateException - if the ServletContext is not available in the application attributes under the appropriate key.
java.lang.Exception

logVelocityMessage

public void logVelocityMessage(int level,
                               java.lang.String message)
Send a log message from Velocity.

Specified by:
logVelocityMessage in interface org.apache.velocity.runtime.log.LogSystem


Copyright (c) 2003 Apache Software Foundation