Class AppenderWrapper
java.lang.Object
org.apache.log4j.bridge.AppenderWrapper
- All Implemented Interfaces:
Appender
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAppenderWrapper(Appender appender) Constructs a new instance for a Core Appender. -
Method Summary
Modifier and TypeMethodDescriptionstatic AppenderAdapts a Log4j 2.x appender into a Log4j 1.x appender.voidAdd 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.Gets the wrapped Core Appender.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.
-
Field Details
-
LOGGER
-
appender
-
-
Constructor Details
-
AppenderWrapper
Constructs a new instance for a Core Appender.- Parameters:
appender- a Core Appender.
-
-
Method Details
-
adapt
Adapts a Log4j 2.x appender into a Log4j 1.x appender. Applying this method on the result ofAppenderAdapter.adapt(Appender)should return the original Log4j 1.x appender.- Parameters:
appender- a Log4j 2.x appender- Returns:
- a Log4j 1.x appender or
nullif the parameter isnull
-
getAppender
-
addFilter
-
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. -
clearFilters
public void clearFilters()Description copied from interface:AppenderClear the list of filters by removing all the filters in it.- Specified by:
clearFiltersin interfaceAppender
-
close
-
doAppend
Description copied from interface:AppenderLog inAppenderspecific way. When appropriate, Loggers will call thedoAppendmethod of appender implementations in order to log. -
getName
-
setErrorHandler
Description copied from interface:AppenderSet theErrorHandlerfor this appender.- Specified by:
setErrorHandlerin interfaceAppender- Parameters:
errorHandler- The error handler.
-
getErrorHandler
Description copied from interface:AppenderReturns theErrorHandlerfor this appender.- Specified by:
getErrorHandlerin interfaceAppender- Returns:
- The error handler.
-
setLayout
-
getLayout
-
setName
-
requiresLayout
public boolean requiresLayout()Description copied from interface:AppenderConfigurators 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.- Specified by:
requiresLayoutin interfaceAppender- Returns:
- true if a Layout is required.
-