org.apache.velocity.tools.generic.log
Class LogChuteCommonsLog

java.lang.Object
  extended by org.apache.velocity.tools.generic.log.LogChuteCommonsLog
All Implemented Interfaces:
org.apache.commons.logging.Log
Direct Known Subclasses:
LogSystemCommonsLog

public class LogChuteCommonsLog
extends java.lang.Object
implements org.apache.commons.logging.Log

Redirects commons-logging messages to Velocity's configured LogChute.

To use, specify this class in your commons-logging.properties:


 org.apache.commons.logging.Log=org.apache.velocity.tools.generic.log.LogChuteCommonsLog
 

Since:
VelocityTools 2.0
Version:
$Id: LogChuteCommonsLog.java 72115 2004-11-11 07:00:54Z nbubna $

Field Summary
private  java.lang.String category
           
private static org.apache.velocity.runtime.log.Log target
           
 
Constructor Summary
LogChuteCommonsLog()
           
LogChuteCommonsLog(java.lang.String category)
           
 
Method Summary
 void debug(java.lang.Object message)
          Passes messages to Velocity's LogChute at "DEBUG" level.
 void debug(java.lang.Object message, java.lang.Throwable t)
          Passes messages to Velocity's LogChute at "DEBUG" level.
 void error(java.lang.Object message)
          Passes messages to Velocity's LogChute at "ERROR" level.
 void error(java.lang.Object message, java.lang.Throwable t)
          Passes messages to Velocity's LogChute at "ERROR" level.
 void fatal(java.lang.Object message)
          Passes messages to Velocity's LogChute at "ERROR" level.
 void fatal(java.lang.Object message, java.lang.Throwable t)
          Passes messages to Velocity's LogChute at "ERROR" level.
protected  org.apache.velocity.runtime.log.Log getTarget()
           
protected static org.apache.velocity.runtime.log.Log getVelocityLog()
          Allow subclasses to statically access the static target.
 void info(java.lang.Object message)
          Passes messages to Velocity's LogChute at "INFO" level.
 void info(java.lang.Object message, java.lang.Throwable t)
          Passes messages to Velocity's LogChute at "INFO" level.
 boolean isDebugEnabled()
          Returns true if Velocity's LogChute returns true for isDebugEnabled().
 boolean isErrorEnabled()
          Returns true if Velocity's LogChute returns true for isErrorEnabled().
 boolean isFatalEnabled()
          Returns true if isErrorEnabled() returns true, since Velocity's LogChute doesn't support this level.
 boolean isInfoEnabled()
          Returns true if Velocity's LogChute returns true for isInfoEnabled().
 boolean isTraceEnabled()
          Returns true if Velocity's LogChute returns true for isTraceEnabled().
 boolean isWarnEnabled()
          Returns true if Velocity's LogChute returns true for isWarnEnabled().
static void setVelocityLog(org.apache.velocity.runtime.log.Log target)
          Set a VelocityEngine to handle all the log messages.
 void trace(java.lang.Object message)
          Passes messages to Velocity's LogChute at "DEBUG" level.
 void trace(java.lang.Object message, java.lang.Throwable t)
          Passes messages to Velocity's LogChute at "DEBUG" level.
 void warn(java.lang.Object message)
          Passes messages to Velocity's LogChute at "WARN" level.
 void warn(java.lang.Object message, java.lang.Throwable t)
          Passes messages to Velocity's LogChute at "WARN" level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

private static org.apache.velocity.runtime.log.Log target

category

private java.lang.String category
Constructor Detail

LogChuteCommonsLog

public LogChuteCommonsLog()

LogChuteCommonsLog

public LogChuteCommonsLog(java.lang.String category)
Method Detail

getVelocityLog

protected static org.apache.velocity.runtime.log.Log getVelocityLog()
Allow subclasses to statically access the static target.


setVelocityLog

public static void setVelocityLog(org.apache.velocity.runtime.log.Log target)
Set a VelocityEngine to handle all the log messages.


getTarget

protected org.apache.velocity.runtime.log.Log getTarget()

trace

public void trace(java.lang.Object message)
Passes messages to Velocity's LogChute at "DEBUG" level. (it's the lowest available. sorry.)

Specified by:
trace in interface org.apache.commons.logging.Log

trace

public void trace(java.lang.Object message,
                  java.lang.Throwable t)
Passes messages to Velocity's LogChute at "DEBUG" level. (it's the lowest available. sorry.)

Specified by:
trace in interface org.apache.commons.logging.Log

debug

public void debug(java.lang.Object message)
Passes messages to Velocity's LogChute at "DEBUG" level.

Specified by:
debug in interface org.apache.commons.logging.Log

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable t)
Passes messages to Velocity's LogChute at "DEBUG" level.

Specified by:
debug in interface org.apache.commons.logging.Log

info

public void info(java.lang.Object message)
Passes messages to Velocity's LogChute at "INFO" level.

Specified by:
info in interface org.apache.commons.logging.Log

info

public void info(java.lang.Object message,
                 java.lang.Throwable t)
Passes messages to Velocity's LogChute at "INFO" level.

Specified by:
info in interface org.apache.commons.logging.Log

warn

public void warn(java.lang.Object message)
Passes messages to Velocity's LogChute at "WARN" level.

Specified by:
warn in interface org.apache.commons.logging.Log

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable t)
Passes messages to Velocity's LogChute at "WARN" level.

Specified by:
warn in interface org.apache.commons.logging.Log

error

public void error(java.lang.Object message)
Passes messages to Velocity's LogChute at "ERROR" level.

Specified by:
error in interface org.apache.commons.logging.Log

error

public void error(java.lang.Object message,
                  java.lang.Throwable t)
Passes messages to Velocity's LogChute at "ERROR" level.

Specified by:
error in interface org.apache.commons.logging.Log

fatal

public void fatal(java.lang.Object message)
Passes messages to Velocity's LogChute at "ERROR" level. (it's the highest available. sorry.)

Specified by:
fatal in interface org.apache.commons.logging.Log

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable t)
Passes messages to Velocity's LogChute at "ERROR" level. (it's the highest available. sorry.)

Specified by:
fatal in interface org.apache.commons.logging.Log

isTraceEnabled

public boolean isTraceEnabled()
Returns true if Velocity's LogChute returns true for isTraceEnabled().

Specified by:
isTraceEnabled in interface org.apache.commons.logging.Log

isDebugEnabled

public boolean isDebugEnabled()
Returns true if Velocity's LogChute returns true for isDebugEnabled().

Specified by:
isDebugEnabled in interface org.apache.commons.logging.Log

isInfoEnabled

public boolean isInfoEnabled()
Returns true if Velocity's LogChute returns true for isInfoEnabled().

Specified by:
isInfoEnabled in interface org.apache.commons.logging.Log

isWarnEnabled

public boolean isWarnEnabled()
Returns true if Velocity's LogChute returns true for isWarnEnabled().

Specified by:
isWarnEnabled in interface org.apache.commons.logging.Log

isErrorEnabled

public boolean isErrorEnabled()
Returns true if Velocity's LogChute returns true for isErrorEnabled().

Specified by:
isErrorEnabled in interface org.apache.commons.logging.Log

isFatalEnabled

public boolean isFatalEnabled()
Returns true if isErrorEnabled() returns true, since Velocity's LogChute doesn't support this level.

Specified by:
isFatalEnabled in interface org.apache.commons.logging.Log


Copyright (c) 2003-2007 Apache Software Foundation