Package org.apache.log4j
Class AppenderSkeleton
- java.lang.Object
-
- org.apache.log4j.AppenderSkeleton
-
- All Implemented Interfaces:
Appender,OptionHandler
- Direct Known Subclasses:
NullAppender,VectorAppender,WriterAppender
public abstract class AppenderSkeleton extends java.lang.Object implements Appender, OptionHandler
The base class for Appenders in Log4j 1. Appenders constructed using this are ignored in Log4j 2.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAppenderSkeleton.NoOpErrorHandler
-
Field Summary
Fields Modifier and Type Field Description protected booleanclosedprotected ErrorHandlererrorHandlerprotected FilterheadFilterprotected Layoutlayoutprotected java.lang.Stringnameprotected FiltertailFilterprotected Prioritythreshold
-
Constructor Summary
Constructors Modifier Constructor Description AppenderSkeleton()Create new instance.protectedAppenderSkeleton(boolean isActive)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidactivateOptions()voidaddFilter(Filter newFilter)Add a filter to the end of the filter list.protected abstract voidappend(LoggingEvent event)voidclearFilters()Clear the list of filters by removing all the filters in it.voiddoAppend(LoggingEvent event)Log inAppenderspecific way.voidfinalize()ErrorHandlergetErrorHandler()Returns theErrorHandlerfor this appender.FiltergetFilter()Returns the head Filter.FiltergetFirstFilter()LayoutgetLayout()Returns this appenders layout.java.lang.StringgetName()Get the name of this appender.PrioritygetThreshold()booleanisAsSevereAsThreshold(Priority priority)voidsetErrorHandler(ErrorHandler eh)Sets theErrorHandlerfor this Appender.voidsetLayout(Layout layout)Set theLayoutfor this appender.voidsetName(java.lang.String name)Set the name of this appender.voidsetThreshold(Priority threshold)-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.log4j.Appender
close, requiresLayout
-
-
-
-
Field Detail
-
layout
protected Layout layout
-
name
protected java.lang.String name
-
threshold
protected Priority threshold
-
errorHandler
protected ErrorHandler errorHandler
-
headFilter
protected Filter headFilter
-
tailFilter
protected Filter tailFilter
-
closed
protected boolean closed
-
-
Method Detail
-
activateOptions
public void activateOptions()
- Specified by:
activateOptionsin interfaceOptionHandler
-
addFilter
public void addFilter(Filter newFilter)
Description copied from interface:AppenderAdd a filter to the end of the filter list.
-
append
protected abstract void append(LoggingEvent event)
-
clearFilters
public void clearFilters()
Description copied from interface:AppenderClear the list of filters by removing all the filters in it.- Specified by:
clearFiltersin interfaceAppender
-
finalize
public void finalize()
- Overrides:
finalizein classjava.lang.Object
-
getErrorHandler
public ErrorHandler getErrorHandler()
Description copied from interface:AppenderReturns theErrorHandlerfor this appender.- Specified by:
getErrorHandlerin interfaceAppender- Returns:
- The error handler.
-
getFilter
public Filter getFilter()
Description copied from interface:AppenderReturns the head Filter. The Filters are organized in a linked list and so all Filters on this Appender are available through the result.
-
getFirstFilter
public final Filter getFirstFilter()
-
getLayout
public Layout getLayout()
Description copied from interface:AppenderReturns this appenders layout.
-
getName
public final java.lang.String getName()
Description copied from interface:AppenderGet the name of this appender.
-
getThreshold
public Priority getThreshold()
-
isAsSevereAsThreshold
public boolean isAsSevereAsThreshold(Priority priority)
-
doAppend
public void doAppend(LoggingEvent event)
Description copied from interface:AppenderLog inAppenderspecific way. When appropriate, Loggers will call thedoAppendmethod of appender implementations in order to log.
-
setErrorHandler
public void setErrorHandler(ErrorHandler eh)
Sets theErrorHandlerfor this Appender.- Specified by:
setErrorHandlerin interfaceAppender- Parameters:
eh- The error handler.- Since:
- 0.9.0
-
setLayout
public void setLayout(Layout layout)
Description copied from interface:AppenderSet theLayoutfor this appender.
-
setName
public void setName(java.lang.String name)
Description copied from interface:AppenderSet the name of this appender. The name is used by other components to identify this appender.
-
setThreshold
public void setThreshold(Priority threshold)
-
-