public class AppenderWrapper extends AppenderAttachableImpl implements Appender
| Constructor and Description |
|---|
AppenderWrapper(org.apache.logging.log4j.core.Appender appender) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(Filter newFilter)
Add a filter to the end of the filter list.
|
void |
clearFilters()
Clear the list of filters by removing all the filters in it.
|
void |
close()
Release any resources allocated within the appender such as file
handles, network connections, etc.
|
void |
doAppend(LoggingEvent event)
Log in
Appender specific way. |
org.apache.logging.log4j.core.Appender |
getAppender() |
ErrorHandler |
getErrorHandler()
Returns the
ErrorHandler for this appender. |
Filter |
getFilter()
Returns the head Filter.
|
Layout |
getLayout()
Returns this appenders layout.
|
String |
getName()
Get the name of this appender.
|
boolean |
requiresLayout()
Configurators call this method to determine if the appender
requires a layout.
|
void |
setErrorHandler(ErrorHandler errorHandler)
Set the
ErrorHandler for this appender. |
void |
setLayout(Layout layout)
Set the
Layout for this appender. |
void |
setName(String name)
Set the name of this appender.
|
addAppender, appendLoopOnAppenders, getAllAppenders, getAppender, isAttached, removeAllAppenders, removeAppender, removeAppenderpublic AppenderWrapper(org.apache.logging.log4j.core.Appender appender)
public org.apache.logging.log4j.core.Appender getAppender()
public void addFilter(Filter newFilter)
Appenderpublic Filter getFilter()
Appenderpublic void clearFilters()
AppenderclearFilters in interface Appenderpublic void close()
AppenderIt is a programming error to append to a closed appender.
close in interface Appenderclose in class AppenderAttachableImplpublic void doAppend(LoggingEvent event)
AppenderAppender specific way. When appropriate,
Loggers will call the doAppend method of appender
implementations in order to log.public String getName()
Appenderpublic void setErrorHandler(ErrorHandler errorHandler)
AppenderErrorHandler for this appender.setErrorHandler in interface AppendererrorHandler - The error handler.public ErrorHandler getErrorHandler()
AppenderErrorHandler for this appender.getErrorHandler in interface Appenderpublic void setLayout(Layout layout)
AppenderLayout for this appender.public Layout getLayout()
Appenderpublic void setName(String name)
Appenderpublic boolean requiresLayout()
Appendertrue,
meaning that layout is required, then the configurator will
configure an layout using the configuration information at its
disposal. If this method returns false, meaning that
a layout is not required, then layout configuration will be
skipped even if there is available layout configuration
information at the disposal of the configurator..
In the rather exceptional case, where the appender
implementation admits a layout but can also work without it, then
the appender should return true.
requiresLayout in interface AppenderCopyright © 1999-1969 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.