Apache log4cxx Version 0.10.0
AppenderSkeleton Class Reference

Implementation base class for all appenders. More...

Inherits Appender, and ObjectImpl.

Inherited by AsyncAppender [virtual], ODBCAppender, SMTPAppender, SocketAppenderSkeleton, SocketHubAppender, SyslogAppender, TelnetAppender, NTEventLogAppender, OutputDebugStringAppender, and WriterAppender.

List of all members.

Public Member Functions

 AppenderSkeleton ()
 AppenderSkeleton (const LayoutPtr &layout)
void addRef () const
void releaseRef () const
void finalize ()
 Finalize this appender by calling the derived class' close method.
virtual void activateOptions (log4cxx::helpers::Pool &)
 Derived appenders should override this method if option structure requires it.
virtual void setOption (const LogString &option, const LogString &value)
 Set option to value.
void addFilter (const spi::FilterPtr &newFilter)
 Add a filter to end of the filter list.
void clearFilters ()
 Clear the filters chain.
const spi::ErrorHandlerPtrgetErrorHandler () const
 Return the currently set spi::ErrorHandler for this Appender.
spi::FilterPtr getFilter () const
 Returns the head Filter.
const spi::FilterPtrgetFirstFilter () const
 Return the first filter in the filter chain for this Appender.
LayoutPtr getLayout () const
 Returns the layout of this appender.
LogString getName () const
 Returns the name of this Appender.
const LevelPtrgetThreshold ()
 Returns this appenders threshold level.
bool isAsSevereAsThreshold (const LevelPtr &level) const
 Check whether the message level is below the appender's threshold.
void doAppend (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool)
 This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method.
void setErrorHandler (const spi::ErrorHandlerPtr &eh)
 Set the ErrorHandler for this Appender.
void setLayout (const LayoutPtr &layout1)
 Set the layout for this appender.
void setName (const LogString &name1)
 Set the name of this Appender.
void setThreshold (const LevelPtr &threshold)
 Set the threshold level.

Protected Member Functions

virtual void append (const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &p)=0
 Subclasses of AppenderSkeleton should implement this method to perform actual logging.

Protected Attributes

LayoutPtr layout
 The layout variable does not need to be set if the appender implementation has its own layout.
LogString name
 Appenders are named.
LevelPtr threshold
 There is no level threshold filtering by default.
spi::ErrorHandlerPtr errorHandler
 It is assumed and enforced that errorHandler is never null.
spi::FilterPtr headFilter
 The first filter in the filter chain.
spi::FilterPtr tailFilter
 The last filter in the filter chain.
bool closed
 Is this appender closed?
log4cxx::helpers::Pool pool
log4cxx::helpers::Mutex mutex

Detailed Description

Implementation base class for all appenders.

This class provides the code for common functionality, such as support for threshold filtering and support for general filters.


Constructor & Destructor Documentation

AppenderSkeleton ( const LayoutPtr layout)

Member Function Documentation

virtual void activateOptions ( log4cxx::helpers::Pool ) [inline, virtual]
void addFilter ( const spi::FilterPtr newFilter) [virtual]

Add a filter to end of the filter list.

Implements Appender.

void addRef ( ) const [virtual]

Reimplemented from ObjectImpl.

Reimplemented in AsyncAppender.

virtual void append ( const spi::LoggingEventPtr event,
log4cxx::helpers::Pool p 
) [protected, pure virtual]
void clearFilters ( ) [virtual]

Clear the filters chain.

Implements Appender.

void doAppend ( const spi::LoggingEventPtr event,
log4cxx::helpers::Pool pool 
) [virtual]

This method performs threshold checks and invokes filters before delegating actual logging to the subclasses specific AppenderSkeleton::append method.

Implements Appender.

void finalize ( )

Finalize this appender by calling the derived class' close method.

const spi::ErrorHandlerPtr& getErrorHandler ( ) const [inline]

Return the currently set spi::ErrorHandler for this Appender.

spi::FilterPtr getFilter ( ) const [inline, virtual]

Returns the head Filter.

Implements Appender.

const spi::FilterPtr& getFirstFilter ( ) const [inline]

Return the first filter in the filter chain for this Appender.

The return value may be 0 if no is filter is set.

LayoutPtr getLayout ( ) const [inline, virtual]

Returns the layout of this appender.

The value may be 0.

Implements Appender.

LogString getName ( ) const [inline, virtual]

Returns the name of this Appender.

Implements Appender.

const LevelPtr& getThreshold ( ) [inline]

Returns this appenders threshold level.

See the setThreshold method for the meaning of this option.

bool isAsSevereAsThreshold ( const LevelPtr level) const

Check whether the message level is below the appender's threshold.

If there is no threshold set, then the return value is always true.

void releaseRef ( ) const [virtual]

Reimplemented from ObjectImpl.

Reimplemented in AsyncAppender.

void setErrorHandler ( const spi::ErrorHandlerPtr eh)

Set the ErrorHandler for this Appender.

void setLayout ( const LayoutPtr layout1) [inline, virtual]

Set the layout for this appender.

Note that some appenders have their own (fixed) layouts or do not use one. For example, the SocketAppender ignores the layout set here.

Implements

Return the currently set spi::ErrorHandler for this Appender.

spi::FilterPtr getFilter ( ) const [inline, virtual]

Returns the head Filter.

Implements Appender.

const spi::FilterPtr& getFirstFilter ( ) const [inline]

Return the first filter in the filter chain for this Appender.

The return value may be 0 if no is filter is set.

LayoutPtr getLayout ( ) const [inline, virtual]

Returns the layout of this appender.

The value may be 0.

Implements Appender.

LogString getName ( ) const [inline, virtual]

Returns the name of this Appender.

Implements Appender.

const LevelPtr& getThreshold ( ) [inline]

Returns this appenders threshold level.

See the setThreshold method for the meaning of this option.

bool isAsSevereAsThreshold ( const LevelPtr level) const

Check whether the message level is below the appender's threshold.

If there is no threshold set, then the return value is always true.

void releaseRef ( ) const [virtual]

Reimplemented from ObjectImpl.

Reimplemented in AsyncAppender.

void setErrorHandler ( const spi::ErrorHandlerPtr eh)

Set the ErrorHandler for this Appender.

void setLayout ( const LayoutPtr layout1) [inline, virtual]

Set the layout for this appender.

Note that some appenders have their own (fixed) layouts or do not use one. For example, the SocketAppender ignores the layout set here.

Implements

Return the currently set spi::ErrorHandler for this Appender.

spi::FilterPtr getFilter ( ) const [inline, virtual]

Returns the head Filter.

Implements Appender.

const spi::FilterPtr& getFirstFilter ( ) const [inline]

Return the first filter in the filter chain for this Appender.

The return value may be 0 if no is filter is set.

LayoutPtr getLayout ( ) const [inline, virtual]

Returns the layout of this appender.

The value may be 0.

Implements Appender.

LogString getName ( ) const [inline, virtual]

Returns the name of this Appender.

Implements Appender.