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

java.lang.Object
  extended by org.apache.velocity.tools.view.servlet.ServletLogger

public class ServletLogger
extends java.lang.Object

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

Version:
$Revision: 477914 $ $Date: 2006-11-21 13:52:11 -0800 (Tue, 21 Nov 2006) $
Author:
Geir Magnusson Jr.

Field Summary
static java.lang.String PREFIX
           
protected  ServletContext servletContext
           
 
Constructor Summary
ServletLogger()
          Construct a simple logger for a servlet environment.
 
Method Summary
 void init(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 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(RuntimeServices rs)
          throws java.lang.Exception
init()

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.



Copyright (c) 2003-2007 Apache Software Foundation