Apache log4cxx
Version 0.11.0
|
The AsyncAppender lets users log events asynchronously. More...
Public Member Functions | |
AsyncAppender () | |
Create new instance. More... | |
virtual | ~AsyncAppender () |
Destructor. More... | |
void | addRef () const |
void | releaseRef () const |
void | addAppender (const AppenderPtr &newAppender) |
Add appender. More... | |
virtual void | doAppend (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool1) |
This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method. More... | |
void | append (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p) |
Subclasses of AppenderSkeleton should implement this method to perform actual logging. More... | |
void | close () |
Close this AsyncAppender by interrupting the dispatcher thread which will process all pending events before exiting. More... | |
AppenderList | getAllAppenders () const |
Get iterator over attached appenders. More... | |
AppenderPtr | getAppender (const LogString &name) const |
Get appender by name. More... | |
bool | getLocationInfo () const |
Gets whether the location of the logging request call should be captured. More... | |
bool | isAttached (const AppenderPtr &appender) const |
Determines if specified appender is attached. More... | |
virtual bool | requiresLayout () const |
Configurators call this method to determine if the appender requires a layout. More... | |
void | removeAllAppenders () |
Removes and closes all attached appenders. More... | |
void | removeAppender (const AppenderPtr &appender) |
Removes an appender. More... | |
void | removeAppender (const LogString &name) |
Remove appender by name. More... | |
void | setLocationInfo (bool flag) |
The LocationInfo attribute is provided for compatibility with log4j and has no effect on the log output. More... | |
void | setBufferSize (int size) |
The BufferSize option takes a non-negative integer value. More... | |
int | getBufferSize () const |
Gets the current buffer size. More... | |
void | setBlocking (bool value) |
Sets whether appender should wait if there is no space available in the event buffer or immediately return. More... | |
bool | getBlocking () const |
Gets whether appender should block calling thread when buffer is full. More... | |
void | setOption (const LogString &option, const LogString &value) |
Set appender properties by name. More... | |
Public Member Functions inherited from AppenderAttachable | |
virtual | ~AppenderAttachable () |
Public Member Functions inherited from Object | |
virtual const helpers::Class & | getClass () const |
virtual | ~Object () |
virtual bool | instanceof (const Class &clazz) const =0 |
virtual const void * | cast (const Class &clazz) const =0 |
Public Member Functions inherited from AppenderSkeleton | |
AppenderSkeleton () | |
AppenderSkeleton (const LayoutPtr &layout) | |
void | finalize () |
Finalize this appender by calling the derived class' close method. More... | |
virtual void | activateOptions (log4cxx::helpers::Pool &) |
Derived appenders should override this method if option structure requires it. More... | |
void | addFilter (const spi::FilterPtr &newFilter) |
Add a filter to end of the filter list. More... | |
void | clearFilters () |
Clear the filters chain. More... | |
const spi::ErrorHandlerPtr & | getErrorHandler () const |
Return the currently set spi::ErrorHandler for this Appender. More... | |
spi::FilterPtr | getFilter () const |
Returns the head Filter. More... | |
const spi::FilterPtr & | getFirstFilter () const |
Return the first filter in the filter chain for this Appender. More... | |
LayoutPtr | getLayout () const |
Returns the layout of this appender. More... | |
LogString | getName () const |
Returns the name of this Appender. More... | |
const LevelPtr & | getThreshold () const |
Returns this appenders threshold level. More... | |
bool | isAsSevereAsThreshold (const LevelPtr &level) const |
Check whether the message level is below the appender's threshold. More... | |
void | setErrorHandler (const spi::ErrorHandlerPtr &eh) |
Set the ErrorHandler for this Appender. More... | |
void | setLayout (const LayoutPtr &layout1) |
Set the layout for this appender. More... | |
void | setName (const LogString &name1) |
Set the name of this Appender. More... | |
void | setThreshold (const LevelPtr &threshold) |
Set the threshold level. More... | |
Public Member Functions inherited from Appender | |
virtual | ~Appender () |
Public Member Functions inherited from OptionHandler | |
virtual | ~OptionHandler () |
Public Member Functions inherited from ObjectImpl | |
ObjectImpl () | |
virtual | ~ObjectImpl () |
void | addRef () const |
void | releaseRef () const |
Additional Inherited Members | |
Static Public Member Functions inherited from Object | |
static const helpers::Class & | getStaticClass () |
static const log4cxx::helpers::ClassRegistration & | registerClass () |
Protected Member Functions inherited from AppenderSkeleton | |
void | doAppendImpl (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool) |
Protected Attributes inherited from AppenderSkeleton | |
LayoutPtr | layout |
The layout variable does not need to be set if the appender implementation has its own layout. More... | |
LogString | name |
Appenders are named. More... | |
LevelPtr | threshold |
There is no level threshold filtering by default. More... | |
spi::ErrorHandlerPtr | errorHandler |
It is assumed and enforced that errorHandler is never null. More... | |
spi::FilterPtr | headFilter |
The first filter in the filter chain. More... | |
spi::FilterPtr | tailFilter |
The last filter in the filter chain. More... | |
bool | closed |
Is this appender closed? More... | |
log4cxx::helpers::Pool | pool |
SHARED_MUTEX | mutex |
Protected Attributes inherited from ObjectImpl | |
unsigned int volatile | ref |
The AsyncAppender lets users log events asynchronously.
It uses a bounded buffer to store logging events.
The AsyncAppender will collect the events sent to it and then dispatch them to all the appenders that are attached to it. You can attach multiple appenders to an AsyncAppender.
The AsyncAppender uses a separate thread to serve the events in its bounded buffer.
Important note: The AsyncAppender
can only be script configured using the DOMConfigurator.
AsyncAppender | ( | ) |
Create new instance.
|
virtual |
Destructor.
|
virtual |
Add appender.
newAppender | appender to add, may not be null. |
Implements AppenderAttachable.
|
virtual |
Reimplemented from AppenderSkeleton.
|
virtual |
Subclasses of AppenderSkeleton
should implement this method to perform actual logging.
See also AppenderSkeleton::doAppend method.
Implements AppenderSkeleton.
|
virtual |
Close this AsyncAppender
by interrupting the dispatcher thread which will process all pending events before exiting.
Implements Appender.
|
virtual |
This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method.
Reimplemented from AppenderSkeleton.
|
virtual |
Get iterator over attached appenders.
Implements AppenderAttachable.
|
virtual |
Get appender by name.
name | name, may not be null. |
Implements AppenderAttachable.
bool getBlocking | ( | ) | const |
Gets whether appender should block calling thread when buffer is full.
If false, messages will be counted by logger and a summary message appended after the contents of the buffer have been appended.
int getBufferSize | ( | ) | const |
Gets the current buffer size.
bool getLocationInfo | ( | ) | const |
Gets whether the location of the logging request call should be captured.
|
virtual |
Determines if specified appender is attached.
appender | appender. |
Implements AppenderAttachable.
|
virtual |
Reimplemented from AppenderSkeleton.
|
virtual |
Removes and closes all attached appenders.
Implements AppenderAttachable.
|
virtual |
|
virtual |
|
virtual |
Configurators call this method to determine if the appender requires a layout.
If this method returns true
, 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
.
Implements Appender.
void setBlocking | ( | bool | value | ) |
Sets whether appender should wait if there is no space available in the event buffer or immediately return.
value | true if appender should wait until available space in buffer. |
void setBufferSize | ( | int | size | ) |
The BufferSize option takes a non-negative integer value.
This integer value determines the maximum size of the bounded buffer.
void setLocationInfo | ( | bool | flag | ) |
The LocationInfo attribute is provided for compatibility with log4j and has no effect on the log output.
flag | new value. |
Set appender properties by name.
option | property name. |
value | property value. |
Reimplemented from AppenderSkeleton.