org.apache.velocity.tools.view.servlet
Class ServletLogger
java.lang.Object
|
+--org.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).
- Author:
- Geir Magnusson Jr.
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 |
servletContext
protected javax.servlet.ServletContext servletContext
PREFIX
public static final java.lang.String PREFIX
- See Also:
- Constant Field Values
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").
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