Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Static Private Member Functions | Private Attributes | Static Private Attributes
log4cpp::Appender Class Reference

#include <Appender.hh>

Inheritance diagram for log4cpp::Appender:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void close ()=0
virtual void doAppend (const LoggingEvent &event)=0
virtual FiltergetFilter ()=0
const std::string & getName () const
virtual Priority::Value getThreshold ()=0
virtual bool reopen ()=0
virtual bool requiresLayout () const =0
virtual void setFilter (Filter *filter)=0
virtual void setLayout (Layout *layout)=0
virtual void setThreshold (Priority::Value priority)=0
virtual ~Appender ()

Static Public Member Functions

static void closeAll ()
static AppendergetAppender (const std::string &name)
static bool reopenAll ()

Protected Member Functions

 Appender (const std::string &name)

Private Types

typedef std::map< std::string,
Appender * > 
AppenderMap

Static Private Member Functions

static void _addAppender (Appender *appender)
static void _deleteAllAppenders ()
static AppenderMap_getAllAppenders ()
static void _removeAppender (Appender *appender)

Private Attributes

const std::string _name

Static Private Attributes

static AppenderMap_allAppenders = 0
static threading::Mutex _appenderMapMutex

Detailed Description

Implement this interface for your own strategies for printing log statements.

Definition at line 33 of file Appender.hh.


Member Typedef Documentation

typedef std::map<std::string, Appender*> log4cpp::Appender::AppenderMap [private]

Definition at line 134 of file Appender.hh.


Constructor & Destructor Documentation

log4cpp::Appender::Appender ( const std::string &  name) [protected]

Constructor for Appender. Will only be used in getAppender() (and in derived classes of course).

Parameters:
nameThe name of this Appender.

Definition at line 72 of file Appender.cpp.

Destructor for Appender.

Definition at line 77 of file Appender.cpp.


Member Function Documentation

void log4cpp::Appender::_addAppender ( Appender appender) [static, private]

Definition at line 32 of file Appender.cpp.

void log4cpp::Appender::_deleteAllAppenders ( ) [static, private]

Definition at line 62 of file Appender.cpp.

Definition at line 18 of file Appender.cpp.

void log4cpp::Appender::_removeAppender ( Appender appender) [static, private]

Definition at line 38 of file Appender.cpp.

virtual void log4cpp::Appender::close ( ) [pure virtual]
void log4cpp::Appender::closeAll ( ) [static]

Call reopen() on all existing Appenders.

Returns:
true if all Appenders returned true on their reopen() call.

Definition at line 54 of file Appender.cpp.

virtual void log4cpp::Appender::doAppend ( const LoggingEvent event) [pure virtual]

Log in Appender specific way.

Parameters:
eventThe LoggingEvent to log.

Implemented in log4cpp::AppenderSkeleton.

Appender * log4cpp::Appender::getAppender ( const std::string &  name) [static]

Get a pointer to an exitsing Appender.

Parameters:
nameThe name of the Appender to return.
Returns:
a pointer to an existing Appender, or NULL if no appender with the specfied name exists.

Definition at line 25 of file Appender.cpp.

virtual Filter* log4cpp::Appender::getFilter ( ) [pure virtual]

Get the Filter for this appender.

Returns:
the filter, or NULL if no filter has been set.

Implemented in log4cpp::AppenderSkeleton.

const std::string& log4cpp::Appender::getName ( ) const [inline]

Get the name of this appender. The name identifies the appender.

Returns:
the name of the appender.

Definition at line 106 of file Appender.hh.

Get the threshold priority of this Appender.

Returns:
the threshold

Implemented in log4cpp::AppenderSkeleton.

virtual bool log4cpp::Appender::reopen ( ) [pure virtual]

Reopens the output destination of this Appender, e.g. the logfile or TCP socket.

Returns:
false if an error occured during reopening, true otherwise.

Implemented in log4cpp::RemoteSyslogAppender, log4cpp::SyslogAppender, log4cpp::AppenderSkeleton, log4cpp::FileAppender, log4cpp::IdsaAppender, log4cpp::StringQueueAppender, log4cpp::AbortAppender, and log4cpp::OstreamAppender.

bool log4cpp::Appender::reopenAll ( ) [static]

Call reopen() on all existing Appenders.

Returns:
true if all Appenders returned true on their reopen() call.

Definition at line 43 of file Appender.cpp.

virtual bool log4cpp::Appender::requiresLayout ( ) const [pure virtual]

Check if the appender uses a layout.

Returns:
true if the appender implementation requires a layout.

Implemented in log4cpp::AppenderSkeleton, log4cpp::IdsaAppender, log4cpp::LayoutAppender, and log4cpp::AbortAppender.

virtual void log4cpp::Appender::setFilter ( Filter filter) [pure virtual]

Set a Filter for this appender.

Implemented in log4cpp::AppenderSkeleton.

virtual void log4cpp::Appender::setLayout ( Layout layout) [pure virtual]

Set the Layout for this appender.

Parameters:
layoutThe layout to use.

Implemented in log4cpp::AppenderSkeleton, log4cpp::IdsaAppender, log4cpp::AbortAppender, and log4cpp::LayoutAppender.

virtual void log4cpp::Appender::setThreshold ( Priority::Value  priority) [pure virtual]

Set the threshold priority of this Appender. The Appender will not appender LoggingEvents with a priority lower than the threshold. Use Priority::NOTSET to disable threshold checking.

Parameters:
priorityThe priority to set.

Implemented in log4cpp::AppenderSkeleton.


Member Data Documentation

Definition at line 136 of file Appender.hh.

Definition at line 137 of file Appender.hh.

const std::string log4cpp::Appender::_name [private]

Definition at line 144 of file Appender.hh.


The documentation for this class was generated from the following files:


log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung.
autogenerated on Wed Sep 16 2015 10:27:14