Package org.apache.velocity.runtime.log
Class Log4JLogChute
- java.lang.Object
-
- org.apache.velocity.runtime.log.Log4JLogChute
-
- All Implemented Interfaces:
LogChute
- Direct Known Subclasses:
Log4JLogSystem
public class Log4JLogChute extends java.lang.Object implements LogChute
Implementation of a simple log4j system that will either latch onto an existing category, or just do a simple rolling file log.- Since:
- Velocity 1.5, 1.5
- Version:
- $Id: Log4JLogChute.java 730039 2008-12-30 03:53:19Z byron $
- Author:
- Daniel L. Rall,
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.log4j.Logger
logger
Log4J logging API.static java.lang.String
RUNTIME_LOG_LOG4J_LOGGER
static java.lang.String
RUNTIME_LOG_LOG4J_LOGGER_LEVEL
-
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
Constructors Constructor Description Log4JLogChute()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
finalize()
Also do a shutdown if the object is destroy()'d.void
init(RuntimeServices rs)
Initializes this LogChute.boolean
isLevelEnabled(int level)
Tell whether or not a log level is enabled.void
log(int level, java.lang.String message)
logs messagesvoid
log(int level, java.lang.String message, java.lang.Throwable t)
Send a log message from Velocity along with an exception or errorvoid
shutdown()
Close all destinations
-
-
-
-
Field Detail
-
RUNTIME_LOG_LOG4J_LOGGER
public static final java.lang.String RUNTIME_LOG_LOG4J_LOGGER
- See Also:
- Constant Field Values
-
RUNTIME_LOG_LOG4J_LOGGER_LEVEL
public static final java.lang.String RUNTIME_LOG_LOG4J_LOGGER_LEVEL
- See Also:
- Constant Field Values
-
logger
protected org.apache.log4j.Logger logger
Log4J logging API.
-
-
Method Detail
-
init
public void init(RuntimeServices rs) throws java.lang.Exception
Description copied from interface:LogChute
Initializes this LogChute.- Specified by:
init
in interfaceLogChute
- Throws:
java.lang.Exception
- See Also:
LogChute.init(org.apache.velocity.runtime.RuntimeServices)
-
log
public void log(int level, java.lang.String message)
logs messages
-
log
public void log(int level, java.lang.String message, java.lang.Throwable t)
Description copied from interface:LogChute
Send a log message from Velocity along with an exception or error- Specified by:
log
in interfaceLogChute
- See Also:
LogChute.log(int, java.lang.String, java.lang.Throwable)
-
isLevelEnabled
public boolean isLevelEnabled(int level)
Description copied from interface:LogChute
Tell whether or not a log level is enabled.- Specified by:
isLevelEnabled
in interfaceLogChute
- Returns:
- True if a level is enabled.
- See Also:
LogChute.isLevelEnabled(int)
-
finalize
protected void finalize() throws java.lang.Throwable
Also do a shutdown if the object is destroy()'d.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
shutdown
public void shutdown()
Close all destinations
-
-