org.apache.velocity.runtime.log
Class Log4JLogSystem

java.lang.Object
  extended byorg.apache.velocity.runtime.log.Log4JLogSystem
All Implemented Interfaces:
LogSystem

public class Log4JLogSystem
extends java.lang.Object
implements LogSystem

Implementation of a simple log4j system that will either latch onto an existing category, or just do a simple rolling file log. Use this one rather than SimpleLog4JLogSystem; it uses the modern Logger concept of Log4J, rather than the deprecated Categeory concept.

Since:
Velocity 1.5
Version:
$Id: Log4JLogSystem.java 75960 2004-03-20 03:35:51Z dlr $
Author:
Daniel L. Rall

Field Summary
protected  org.apache.log4j.Logger logger
          Log4J logging API.
private  RuntimeServices rsvc
           
static java.lang.String RUNTIME_LOG_LOG4J_LOGGER
           
 
Fields inherited from interface org.apache.velocity.runtime.log.LogSystem
DEBUG_ID, DEBUG_ON, ERROR_ID, INFO_ID, WARN_ID
 
Constructor Summary
Log4JLogSystem()
          Log4J logging API.
 
Method Summary
protected  void finalize()
          Also do a shutdown if the object is destroy()'d.
 void init(RuntimeServices rs)
          init()
private  void internalInit(java.lang.String logfile)
          initializes the log system using the logfile argument
 void logVelocityMessage(int level, java.lang.String message)
          logs messages
 void shutdown()
          Close all destinations
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RUNTIME_LOG_LOG4J_LOGGER

public static final java.lang.String RUNTIME_LOG_LOG4J_LOGGER
See Also:
Constant Field Values

rsvc

private RuntimeServices rsvc

logger

protected org.apache.log4j.Logger logger
Log4J logging API.

Constructor Detail

Log4JLogSystem

public Log4JLogSystem()
Log4J logging API.

Method Detail

init

public void init(RuntimeServices rs)
Description copied from interface: LogSystem
init()

Specified by:
init in interface LogSystem

internalInit

private void internalInit(java.lang.String logfile)
                   throws java.lang.Exception
initializes the log system using the logfile argument

Throws:
java.lang.Exception

logVelocityMessage

public void logVelocityMessage(int level,
                               java.lang.String message)
logs messages

Specified by:
logVelocityMessage in interface LogSystem
Parameters:
level - severity level
message - complete error message

finalize

protected void finalize()
                 throws java.lang.Throwable
Also do a shutdown if the object is destroy()'d.

Throws:
java.lang.Throwable

shutdown

public void shutdown()
Close all destinations



Copyright ? 2002 Apache Software Foundation. All Rights Reserved.