|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.slf4j.Slf4jLogChute
public class Slf4jLogChute
This class was taken from the Velocity SVN since it was not yet released (v 2.0), but needed for integrating Velocity log with slf4j. Redirects Velocity's LogChute messages to SLF4J.
To use, first set up SLF4J, then tell Velocity to use
this class for logging by adding the following to your velocity.properties:
runtime.log.logsystem.class = org.apache.velocity.slf4j.Slf4jLogChute
You may also set this property to specify what log/name Velocity's
messages should be logged to (example below is default).
runtime.log.logsystem.slf4j.name = org.apache.velocity
Field Summary | |
---|---|
static String |
DEFAULT_LOG_NAME
Default name for the commons-logging instance |
protected org.slf4j.Logger |
log
the commons-logging Log instance |
static String |
LOGCHUTE_SLF4J_NAME
Property key for specifying the name for the log instance |
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 | |
---|---|
Slf4jLogChute()
|
Method Summary | |
---|---|
void |
init(org.apache.velocity.runtime.RuntimeServices rs)
LogChute methods |
boolean |
isLevelEnabled(int level)
Checks whether the specified log level is enabled. |
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 with an error. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOGCHUTE_SLF4J_NAME
public static final String DEFAULT_LOG_NAME
protected org.slf4j.Logger log
Constructor Detail |
---|
public Slf4jLogChute()
Method Detail |
---|
public void init(org.apache.velocity.runtime.RuntimeServices rs)
init
in interface org.apache.velocity.runtime.log.LogChute
public void log(int level, String message)
log
in interface org.apache.velocity.runtime.log.LogChute
public void log(int level, String message, Throwable t)
log
in interface org.apache.velocity.runtime.log.LogChute
public boolean isLevelEnabled(int level)
isLevelEnabled
in interface org.apache.velocity.runtime.log.LogChute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |