org.apache.velocity.runtime.log

Class SimpleLog4JLogSystem

Implemented Interfaces:
LogSystem

public class SimpleLog4JLogSystem
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. Derived from Jon's 'complicated' version :)
Version:
$Id: SimpleLog4JLogSystem.java,v 1.1.8.1 2004/03/03 23:22:57 geirm Exp $
Author:

Field Summary

protected Category
logger
log4java logging interface
private RuntimeServices
rsvc

Fields inherited from interface org.apache.velocity.runtime.log.LogSystem

DEBUG_ID, DEBUG_ON, ERROR_ID, INFO_ID, WARN_ID

Constructor Summary

SimpleLog4JLogSystem()

Method Summary

protected void
finalize()
Also do a shutdown if the object is destroy()'d.
void
init(RuntimeServices rs)
private void
internalInit(String logfile)
initializes the log system using the logfile argument
void
logVelocityMessage(int level, String message)
logs messages
void
shutdown()
Close all destinations

Field Details

logger

protected Category logger
log4java logging interface

rsvc

private RuntimeServices rsvc

Constructor Details

SimpleLog4JLogSystem

public SimpleLog4JLogSystem()

Method Details

finalize

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

init

public void init(RuntimeServices rs)
Specified by:
init in interface LogSystem

internalInit

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

logVelocityMessage

public void logVelocityMessage(int level,
                               String message)
logs messages
Specified by:
logVelocityMessage in interface LogSystem
Parameters:
level - severity level
message - complete error message

shutdown

public void shutdown()
Close all destinations

Copyright B) 2002 Apache Software Foundation. All Rights Reserved.