org.apache.velocity.runtime.log

Class Log4JLogSystem

Implemented Interfaces:
LogSystem

public class Log4JLogSystem
extends java.lang.Object
implements LogSystem

Implementation of a Log4J logger. SimpleLog4jLogSystem

Version:
$Id: Log4JLogSystem.java,v 1.6 2002/03/15 03:36:14 geirm Exp $

Author:
Jon S. Stevens

Nested Class Summary

Field Summary

protected Layout
layout
logging layout
private String
logfile
the runtime.log property value
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

Log4JLogSystem()
default CTOR.

Method Summary

private void
configureEmail()
Configures the logging to email
private void
configureFile()
Configures the logging to a file.
private void
configureRemote()
Configures the logging to a remote server
private void
configureSyslog()
Configures the logging to syslogd
protected void
finalize()
Also do a shutdown if the object is destroy()'d.
void
init(RuntimeServices rs)
private void
internalInit()
initializes the log system using the logfile argument
void
logVelocityMessage(int level, String message)
logs messages
void
shutdown()
Close all destinations

Field Details

layout

protected Layout layout
logging layout


logfile

private String logfile
the runtime.log property value


logger

protected Category logger
log4java logging interface


rsvc

private RuntimeServices rsvc

Constructor Details

Log4JLogSystem

public Log4JLogSystem()
default CTOR. Initializes itself using the property RUNTIME_LOG from the Velocity properties

Method Details

configureEmail

private void configureEmail()
            throws Exception
Configures the logging to email


configureFile

private void configureFile()
            throws Exception
Configures the logging to a file.


configureRemote

private void configureRemote()
            throws Exception
Configures the logging to a remote server


configureSyslog

private void configureSyslog()
            throws Exception
Configures the logging to syslogd


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()
            throws Exception
initializes the log system using the logfile argument

Parameters:


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 © 2003 Apache Software Foundation. All Rights Reserved.