|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.velocity.runtime.log.ServletLogChute
Simple wrapper for the servlet log. This passes Velocity log messages to ServletContext.log(String). You may configure the level of output in your velocity.properties by adding the "runtime.log.logsystem.servlet.level" property with one of the following values: error, warn, info, debug, or trace. The default is trace.
| Field Summary | |
static String |
PREFIX
|
static String |
RUNTIME_LOG_LEVEL_KEY
|
protected ServletContext |
servletContext
|
| Fields inherited from interface org.apache.velocity.runtime.log.LogChute |
DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX |
| Constructor Summary | |
ServletLogChute()
Construct a simple logger for a servlet environment. |
|
| Method Summary | |
int |
getEnabledLevel()
Returns the current minimum level at which messages will be printed. |
void |
init(RuntimeServices rs)
init() |
boolean |
isLevelEnabled(int level)
This will return true if the specified level is equal to or higher than the level this LogChute is enabled for. |
void |
log(int level,
String message)
Send a log message from Velocity. |
void |
log(int level,
String message,
Throwable t)
Send a log message from Velocity along with an exception or error |
void |
setEnabledLevel(int level)
Set the minimum level at which messages will be printed. |
protected int |
toLevel(String level)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String RUNTIME_LOG_LEVEL_KEY
protected ServletContext servletContext
public static final String PREFIX
| Constructor Detail |
public ServletLogChute()
| Method Detail |
public void init(RuntimeServices rs)
throws Exception
init in interface LogChuters -
IllegalStateException - if the ServletContext is not available
in the application attributes under the appropriate key.
Exceptionprotected int toLevel(String level)
public void setEnabledLevel(int level)
public int getEnabledLevel()
public boolean isLevelEnabled(int level)
isLevelEnabled in interface LogChutelevel -
public void log(int level,
String message)
log in interface LogChutelevel - message -
public void log(int level,
String message,
Throwable t)
LogChute
log in interface LogChutelevel - message - t -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||