Package org.apache.log4j.varia
Class NullAppender
java.lang.Object
org.apache.log4j.AppenderSkeleton
org.apache.log4j.varia.NullAppender
- All Implemented Interfaces:
Appender
,OptionHandler
A NullAppender never outputs a message to any device.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.log4j.AppenderSkeleton
AppenderSkeleton.NoOpErrorHandler
-
Field Summary
FieldsFields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
There are no options to acticate.protected void
append
(LoggingEvent event) Does not do anything.void
close()
Release any resources allocated within the appender such as file handles, network connections, etc.void
doAppend
(LoggingEvent event) Does not do anything.Deprecated.Use getNullAppender instead.static NullAppender
Whenever you can, use this method to retreive an instance instead of instantiating a new one withnew
.boolean
NullAppenders do not need a layout.Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NullAppender
public NullAppender()
-
-
Method Details
-
getNullAppender
Whenever you can, use this method to retreive an instance instead of instantiating a new one withnew
. -
activateOptions
public void activateOptions()There are no options to acticate.- Specified by:
activateOptions
in interfaceOptionHandler
- Overrides:
activateOptions
in classAppenderSkeleton
-
append
Does not do anything.- Specified by:
append
in classAppenderSkeleton
-
close
public void close()Description copied from interface:Appender
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.
-
doAppend
Does not do anything.- Specified by:
doAppend
in interfaceAppender
- Overrides:
doAppend
in classAppenderSkeleton
- Parameters:
event
- The LoggingEvent.
-
getInstance
Deprecated.Use getNullAppender instead. getInstance should have been static.Whenever you can, use this method to retreive an instance instead of instantiating a new one withnew
. -
requiresLayout
public boolean requiresLayout()NullAppenders do not need a layout.- Returns:
- true if a Layout is required.
-