org.apache.velocity.tools.generic

## Class LogTool

- java.lang.Object
- - org.apache.velocity.tools.generic.SafeConfig
  - - org.apache.velocity.tools.generic.LogTool

All Implemented Interfaces:
  Serializable

    @DefaultKey(value="log")
     @ValidScope(value="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>

Since:
  VelocityTools 3.0
Version:
  $Id: $
Author:
  Claude Brisson
See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.velocity.tools.generic.SafeConfig

`LOCK_CONFIG_KEY, log, LOGGER_NAME_KEY, SAFE_MODE_KEY, USE_CLASS_LOGGER_KEY`

### Constructor Summary

Constructors
Constructor and Description
`LogTool()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `debug(String message)`
`void` `error(String message)`
`void` `info(String message)`
`void` `trace(String message)`
`void` `warn(String message)`

### Methods inherited from class org.apache.velocity.tools.generic.SafeConfig

`configure, configure, getLog, initLogger, isConfigLocked, isSafeMode, setLockConfig, setSafeMode`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### LogTool

    public LogTool()

### Method Detail

#### error

    public void error(String message)

#### warn

    public void warn(String message)

#### info

    public void info(String message)

#### debug

    public void debug(String message)

#### trace

    public void trace(String message)