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
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:
- <a href="mailto:geirm@apache.org>Geir Magnusson Jr., <a href="mailto:dlr@finemaltcoding.com>Daniel L. Rall, <a href="mailto:nbubna@apache.org>Nathan Bubna
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.log4j.Logger
Log4J logging API.static final String
static final String
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
logs messagesvoid
Send a log message from Velocity along with an exception or errorvoid
shutdown()
Close all destinations
-
Field Details
-
RUNTIME_LOG_LOG4J_LOGGER
- See Also:
-
RUNTIME_LOG_LOG4J_LOGGER_LEVEL
- See Also:
-
logger
protected org.apache.log4j.Logger loggerLog4J logging API.
-
-
Constructor Details
-
Log4JLogChute
public Log4JLogChute()
-
-
Method Details
-
init
Description copied from interface:LogChute
Initializes this LogChute. -
log
logs messages -
log
Description copied from interface:LogChute
Send a log message from Velocity along with an exception or error -
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:
-
finalize
Also do a shutdown if the object is destroy()'d. -
shutdown
public void shutdown()Close all destinations
-