Package com.jalios.jcms.tools
Class LogAppender
- java.lang.Object
-
- org.apache.log4j.AppenderSkeleton
-
- 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
- Author:
- Jean-Philippe Encausse
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<org.apache.log4j.spi.LoggingEvent>
eventList
protected int
maximumEventNbr
protected java.lang.String
prefix
-
Constructor Summary
Constructors Constructor Description LogAppender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
append(org.apache.log4j.spi.LoggingEvent event)
void
close()
java.util.List<org.apache.log4j.spi.LoggingEvent>
getLoggedEventList()
Returns a new List of latest LoggingEventint
getMaximumEventNbr()
Returns the current value of the MaximumEvent option.java.lang.String
getPrefix()
boolean
requiresLayout()
void
setMaximumEventNbr(int size)
The MaximumEventNbr option takes a integer between 5 and 500.void
setPrefix(java.lang.String prefix)
-
-
-
Method Detail
-
append
protected void append(org.apache.log4j.spi.LoggingEvent event)
- Specified by:
append
in classorg.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(java.lang.String prefix)
-
getPrefix
public java.lang.String getPrefix()
-
getLoggedEventList
public java.util.List<org.apache.log4j.spi.LoggingEvent> getLoggedEventList()
Returns a new List of latest LoggingEvent- Returns:
- List of LoggingEvent
-
-