Class CommonsLogLogSystem
- java.lang.Object
-
- org.apache.velocity.tools.generic.log.CommonsLogLogSystem
-
- All Implemented Interfaces:
org.apache.velocity.runtime.log.LogSystem
public class CommonsLogLogSystem extends java.lang.Object implements org.apache.velocity.runtime.log.LogSystemRedirects Velocity's LogSystem messages to commons-logging.To use, first set up commons-logging, then tell Velocity to use this class for logging by adding the following to your velocity.properties:
runtime.log.logsystem.class = org.apache.velocity.tools.generic.log.CommonsLogLogSystemYou may also set this property to specify what log/name Velocity's messages should be logged to (example below is default).
runtime.log.logsystem.commons.logging.name = org.apache.velocity- Since:
- VelocityTools 1.1
- Version:
- $Id: CommonsLogLogSystem.java 479724 2006-11-27 18:49:37Z nbubna $
- Author:
- Nathan Bubna
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_LOG_NAMEDefault name for the commons-logging instanceprotected org.apache.commons.logging.Loglogthe commons-logging Log instancestatic java.lang.StringLOGSYSTEM_COMMONS_LOG_NAMEProperty key for specifying the name for the log instance
-
Constructor Summary
Constructors Constructor Description CommonsLogLogSystem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(org.apache.velocity.runtime.RuntimeServices rs)LogSystem methodsvoidlogVelocityMessage(int level, java.lang.String message)Send a log message from Velocity.
-
-
-
Field Detail
-
LOGSYSTEM_COMMONS_LOG_NAME
public static final java.lang.String LOGSYSTEM_COMMONS_LOG_NAME
Property key for specifying the name for the log instance- See Also:
- Constant Field Values
-
DEFAULT_LOG_NAME
public static final java.lang.String DEFAULT_LOG_NAME
Default name for the commons-logging instance- See Also:
- Constant Field Values
-
log
protected org.apache.commons.logging.Log log
the commons-logging Log instance
-
-
Method Detail
-
init
public void init(org.apache.velocity.runtime.RuntimeServices rs) throws java.lang.ExceptionLogSystem methods- Specified by:
initin interfaceorg.apache.velocity.runtime.log.LogSystem- Throws:
java.lang.Exception
-
logVelocityMessage
public void logVelocityMessage(int level, java.lang.String message)Send a log message from Velocity.- Specified by:
logVelocityMessagein interfaceorg.apache.velocity.runtime.log.LogSystem
-
-