类 LogTool
java.lang.Object
org.apache.velocity.tools.generic.SafeConfig
org.apache.velocity.tools.generic.LogTool
- 所有已实现的接口:
Serializable
@DefaultKey("log")
@ValidScope("application")
public class LogTool
extends SafeConfig
implements Serializable
This tool is used to log from within templates.
Of course, the desired log level must have been configured, using the method specific to the SLF4J implementation you are using. For instance, when using the webapp-slf4j-logger, you will use the following snippet of code in you /WEB-INF/web.xml file:
<context-param> <param-name>webapp-slf4j-logger.level</param-name> <param-value>debug</param-value> </context-param>
You can optionnaly specify the logger name in the config (the default is to re-use the engine logger):
<tools>
<toolbox scope="application">
<tool class="org.apache.velocity.tools.generic.LogTool"/>
</toolbox>
</tools>
- 从以下版本开始:
- VelocityTools 3.0
- 版本:
- $Id: $
- 作者:
- Claude Brisson
- 另请参阅:
-
字段概要
从类继承的字段 org.apache.velocity.tools.generic.SafeConfig
LOCK_CONFIG_KEY, log, LOGGER_NAME_KEY, SAFE_MODE_KEY, USE_CLASS_LOGGER_KEY -
构造器概要
构造器 -
方法概要
从类继承的方法 org.apache.velocity.tools.generic.SafeConfig
configure, configure, getLog, initLogger, isConfigLocked, isSafeMode, setLockConfig, setSafeMode
-
构造器详细资料
-
LogTool
public LogTool()
-
-
方法详细资料
-
error
-
warn
-
info
-
debug
-
trace
-