com.jalios.jcms.tools
Class LogAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by com.jalios.jcms.tools.LogAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler
Direct Known Subclasses:
MailAppender

public abstract class LogAppender
extends org.apache.log4j.AppenderSkeleton

A log4j appender that keeps from 5 to 500 LoggingEvent.
It does not need any layout.

 <appender name="JCMS" class="com.jalios.jcms.mail.MailAppender">
   <param name="MaximumEventNbr" value="20"/>
 </appender>
 

Since:
jcms-5.7.0
Version:
$Revision: 27753 $
Author:
Jean-Philippe Encausse

Field Summary
protected  List<org.apache.log4j.spi.LoggingEvent> eventList
           
protected  int maximumEventNbr
           
protected  String prefix
           
static String REVISION
           
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
LogAppender()
           
 
Method Summary
protected  void append(org.apache.log4j.spi.LoggingEvent event)
           
 void close()
           
 List<org.apache.log4j.spi.LoggingEvent> getLoggedEventList()
          Returns a new List of latest LoggingEvent
 int getMaximumEventNbr()
          Returns the current value of the MaximumEvent option.
 String getPrefix()
           
 boolean requiresLayout()
           
 void setMaximumEventNbr(int size)
          The MaximumEventNbr option takes a integer between 5 and 500.
 void setPrefix(String prefix)
           
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

eventList

protected List<org.apache.log4j.spi.LoggingEvent> eventList

maximumEventNbr

protected int maximumEventNbr

prefix

protected String prefix
Constructor Detail

LogAppender

public LogAppender()
Method Detail

append

protected void append(org.apache.log4j.spi.LoggingEvent event)
Specified by:
append in class org.apache.log4j.AppenderSkeleton

requiresLayout

public boolean requiresLayout()

close

public void close()

setMaximumEventNbr

public void setMaximumEventNbr(int size)
The MaximumEventNbr option takes a integer between 5 and 500. This integer value determines the maximum number of event kept by this appender.


getMaximumEventNbr

public int getMaximumEventNbr()
Returns the current value of the MaximumEvent option.


setPrefix

public void setPrefix(String prefix)

getPrefix

public String getPrefix()

getLoggedEventList

public List<org.apache.log4j.spi.LoggingEvent> getLoggedEventList()
Returns a new List of latest LoggingEvent

Returns:
List of LoggingEvent


Copyright © 2001-2010 Jalios SA. All Rights Reserved.