Package org.apache.log4j
Interface Appender
-
@Deprecated(since="2022-01-27") public interface Appender
Deprecated.Apache Log4j 1 has reached end of life in 2015 and is no longer supported.Implement this interface for your own strategies for outputting log statements.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addFilter(Filter newFilter)
Deprecated.Add a filter to the end of the filter list.void
clearFilters()
Deprecated.Clear the list of filters by removing all the filters in it.void
close()
Deprecated.Release any resources allocated within the appender such as file handles, network connections, etc.void
doAppend(LoggingEvent event)
Deprecated.Log inAppender
specific way.ErrorHandler
getErrorHandler()
Deprecated.Returns theErrorHandler
for this appender.Filter
getFilter()
Deprecated.Returns the head Filter.Layout
getLayout()
Deprecated.Returns this appenders layout.java.lang.String
getName()
Deprecated.Get the name of this appender.boolean
requiresLayout()
Deprecated.Configurators call this method to determine if the appender requires a layout.void
setErrorHandler(ErrorHandler errorHandler)
Deprecated.Set theErrorHandler
for this appender.void
setLayout(Layout layout)
Deprecated.Set theLayout
for this appender.void
setName(java.lang.String name)
Deprecated.Set the name of this appender.
-
-
-
Method Detail
-
addFilter
void addFilter(Filter newFilter)
Deprecated.Add a filter to the end of the filter list.- Since:
- 0.9.0
-
getFilter
Filter getFilter()
Deprecated.Returns the head Filter. The Filters are organized in a linked list and so all Filters on this Appender are available through the result.- Returns:
- the head Filter or null, if no Filters are present
- Since:
- 1.1
-
clearFilters
void clearFilters()
Deprecated.Clear the list of filters by removing all the filters in it.- Since:
- 0.9.0
-
close
void close()
Deprecated.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
void doAppend(LoggingEvent event)
Deprecated.Log inAppender
specific way. When appropriate, Loggers will call thedoAppend
method of appender implementations in order to log.
-
getName
java.lang.String getName()
Deprecated.Get the name of this appender. The name uniquely identifies the appender.
-
setErrorHandler
void setErrorHandler(ErrorHandler errorHandler)
Deprecated.Set theErrorHandler
for this appender.- Since:
- 0.9.0
-
getErrorHandler
ErrorHandler getErrorHandler()
Deprecated.Returns theErrorHandler
for this appender.- Since:
- 1.1
-
getLayout
Layout getLayout()
Deprecated.Returns this appenders layout.- Since:
- 1.1
-
setName
void setName(java.lang.String name)
Deprecated.Set the name of this appender. The name is used by other components to identify this appender.- Since:
- 0.8.1
-
requiresLayout
boolean requiresLayout()
Deprecated.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 an 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
-
-