Package org.apache.log4j
Interface Appender
public interface Appender
Implement this interface for your own strategies for outputting log
statements.
- Author:
- Ceki Gülcü
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a filter to the end of the filter list.voidClear the list of filters by removing all the filters in it.voidclose()Release any resources allocated within the appender such as file handles, network connections, etc.voiddoAppend(LoggingEvent event) Log inAppenderspecific way.Returns theErrorHandlerfor this appender.Returns the head Filter.Returns this appenders layout.getName()Get the name of this appender.booleanConfigurators call this method to determine if the appender requires a layout.voidsetErrorHandler(ErrorHandler errorHandler) Set theErrorHandlerfor this appender.voidSet theLayoutfor this appender.voidSet the name of this appender.
-
Method Details
-
addFilter
-
getFilter
-
clearFilters
-
close
void close()Release any resources allocated within the appender such as file handles, network connections, etc.It is a programming error to append to a closed appender.
- Since:
- 0.8.4
-
doAppend
Log inAppenderspecific way. When appropriate, Loggers will call thedoAppendmethod of appender implementations in order to log. -
getName
-
setErrorHandler
Set theErrorHandlerfor this appender.- Since:
- 0.9.0
-
getErrorHandler
-
setLayout
-
getLayout
-
setName
-
requiresLayout
boolean requiresLayout()Configurators call this method to determine if the appender requires a layout. If this method returnstrue, meaning that layout is required, then the configurator will configure a layout using the configuration information at its disposal. If this method returnsfalse, 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.- Since:
- 0.8.4
-