Package org.apache.log4j
Class AppenderSkeleton
- java.lang.Object
-
- org.apache.log4j.AppenderSkeleton
-
- All Implemented Interfaces:
Appender
,OptionHandler
- Direct Known Subclasses:
ConsoleAppender
,WriterAppender
public abstract class AppenderSkeleton extends 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 class
AppenderSkeleton.NoOpErrorHandler
-
Field Summary
Fields Modifier and Type Field Description protected boolean
closed
protected ErrorHandler
errorHandler
protected Filter
headFilter
protected Layout
layout
protected String
name
protected Filter
tailFilter
protected Priority
threshold
-
Constructor Summary
Constructors Modifier Constructor Description AppenderSkeleton()
Create new instance.protected
AppenderSkeleton(boolean isActive)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
activateOptions()
void
addFilter(Filter newFilter)
Add a filter to the end of the filter list.protected abstract void
append(LoggingEvent event)
void
clearFilters()
Clear the list of filters by removing all the filters in it.void
doAppend(LoggingEvent event)
This method is never going to be called in Log4j 2 so there isn't much point in having any code in it.void
finalize()
ErrorHandler
getErrorHandler()
Returns theErrorHandler
for this appender.Filter
getFilter()
Returns the head Filter.Filter
getFirstFilter()
Layout
getLayout()
Returns this appenders layout.String
getName()
Get the name of this appender.Priority
getThreshold()
boolean
isAsSevereAsThreshold(Priority priority)
void
setErrorHandler(ErrorHandler eh)
Set theErrorHandler
for this Appender.void
setLayout(Layout layout)
Set theLayout
for this appender.void
setName(String name)
Set the name of this appender.void
setThreshold(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
-
-
-
-
Method Detail
-
activateOptions
public void activateOptions()
- Specified by:
activateOptions
in interfaceOptionHandler
-
addFilter
public void addFilter(Filter newFilter)
Description copied from interface:Appender
Add a filter to the end of the filter list.
-
append
protected abstract void append(LoggingEvent event)
-
clearFilters
public void clearFilters()
Description copied from interface:Appender
Clear the list of filters by removing all the filters in it.- Specified by:
clearFilters
in interfaceAppender
-
getErrorHandler
public ErrorHandler getErrorHandler()
Description copied from interface:Appender
Returns theErrorHandler
for this appender.- Specified by:
getErrorHandler
in interfaceAppender
- Returns:
- The error handler.
-
getFilter
public Filter getFilter()
Description copied from interface:Appender
Returns 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:Appender
Returns this appenders layout.
-
getName
public final String getName()
Description copied from interface:Appender
Get the name of this appender.
-
getThreshold
public Priority getThreshold()
-
isAsSevereAsThreshold
public boolean isAsSevereAsThreshold(Priority priority)
-
doAppend
public void doAppend(LoggingEvent event)
This method is never going to be called in Log4j 2 so there isn't much point in having any code in it.
-
setErrorHandler
public void setErrorHandler(ErrorHandler eh)
Set theErrorHandler
for this Appender.- Specified by:
setErrorHandler
in interfaceAppender
- Parameters:
eh
- The error handler.- Since:
- 0.9.0
-
setLayout
public void setLayout(Layout layout)
Description copied from interface:Appender
Set theLayout
for this appender.
-
setName
public void setName(String name)
Description copied from interface:Appender
Set the name of this appender. The name is used by other components to identify this appender.
-
setThreshold
public void setThreshold(Priority threshold)
-
-