Implement this interface for your own strategies for printing log statements. More...
#include <Appender.hh>
Public Member Functions | |
virtual void | close ()=0 |
Release any resources allocated within the appender such as file handles, network connections, etc. | |
virtual void | doAppend (const LoggingEvent &event)=0 |
Log in Appender specific way. | |
virtual Filter * | getFilter ()=0 |
Get the Filter for this appender. | |
const std::string & | getName () const |
Get the name of this appender. | |
virtual Priority::Value | getThreshold ()=0 |
Get the threshold priority of this Appender. | |
virtual bool | reopen ()=0 |
Reopens the output destination of this Appender, e.g. | |
virtual bool | requiresLayout () const =0 |
Check if the appender uses a layout. | |
virtual void | setFilter (Filter *filter)=0 |
Set a Filter for this appender. | |
virtual void | setLayout (Layout *layout)=0 |
Set the Layout for this appender. | |
virtual void | setThreshold (Priority::Value priority)=0 |
Set the threshold priority of this Appender. | |
virtual | ~Appender () |
Destructor for Appender. | |
Static Public Member Functions | |
static void | closeAll () |
Call reopen() on all existing Appenders. | |
static Appender * | getAppender (const std::string &name) |
Get a pointer to an existing Appender. | |
static bool | reopenAll () |
Call reopen() on all existing Appenders. | |
Protected Member Functions | |
Appender (const std::string &name) | |
Constructor for Appender. | |
Private Types | |
typedef std::map< std::string, Appender * > | AppenderMap |
Private Member Functions | |
Appender & | operator= (const Appender &) |
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 |
static threading::Mutex | _appenderMapMutex |
Friends | |
class | HierarchyMaintainer |
Implement this interface for your own strategies for printing log statements.
Definition at line 33 of file Appender.hh.
typedef std::map<std::string, Appender*> Appender::AppenderMap [private] |
Definition at line 137 of file Appender.hh.
Appender::Appender | ( | const std::string & | name | ) | [protected] |
Constructor for Appender.
Will only be used in getAppender() (and in derived classes of course).
name | The name of this Appender. |
virtual Appender::~Appender | ( | ) | [virtual] |
Destructor for Appender.
static void Appender::_addAppender | ( | Appender * | appender | ) | [static, private] |
static void Appender::_deleteAllAppenders | ( | ) | [static, private] |
static AppenderMap& Appender::_getAllAppenders | ( | ) | [static, private] |
static void Appender::_removeAppender | ( | Appender * | appender | ) | [static, private] |
virtual void Appender::close | ( | ) | [pure virtual] |
Release any resources allocated within the appender such as file handles, network connections, etc.
Implemented in RemoteSyslogAppender, AppenderSkeleton, SyslogAppender, FileAppender, IdsaAppender, StringQueueAppender, AbortAppender, OstreamAppender, and BufferingAppender.
static void Appender::closeAll | ( | ) | [static] |
virtual void Appender::doAppend | ( | const LoggingEvent & | event | ) | [pure virtual] |
Log in Appender specific way.
event | The LoggingEvent to log. |
Implemented in AppenderSkeleton.
static Appender* Appender::getAppender | ( | const std::string & | name | ) | [static] |
virtual Filter* Appender::getFilter | ( | ) | [pure virtual] |
Get the Filter for this appender.
Implemented in AppenderSkeleton.
const std::string& Appender::getName | ( | ) | const [inline] |
Get the name of this appender.
The name identifies the appender.
Definition at line 109 of file Appender.hh.
virtual Priority::Value Appender::getThreshold | ( | ) | [pure virtual] |
virtual bool Appender::reopen | ( | ) | [pure virtual] |
Reopens the output destination of this Appender, e.g.
the logfile or TCP socket.
Implemented in RemoteSyslogAppender, SyslogAppender, AppenderSkeleton, FileAppender, IdsaAppender, StringQueueAppender, AbortAppender, and OstreamAppender.
static bool Appender::reopenAll | ( | ) | [static] |
virtual bool Appender::requiresLayout | ( | ) | const [pure virtual] |
Check if the appender uses a layout.
Implemented in AppenderSkeleton, IdsaAppender, LayoutAppender, and AbortAppender.
virtual void Appender::setFilter | ( | Filter * | filter | ) | [pure virtual] |
Set a Filter for this appender.
Implemented in AppenderSkeleton.
virtual void Appender::setLayout | ( | Layout * | layout | ) | [pure virtual] |
Set the Layout for this appender.
layout | The layout to use. |
Implemented in AppenderSkeleton, IdsaAppender, AbortAppender, and LayoutAppender.
virtual void 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.
priority | The priority to set. |
Implemented in AppenderSkeleton.
friend class HierarchyMaintainer [friend] |
Definition at line 37 of file Appender.hh.
AppenderMap* Appender::_allAppenders [static, private] |
Definition at line 139 of file Appender.hh.
threading::Mutex Appender::_appenderMapMutex [static, private] |
Definition at line 140 of file Appender.hh.
const std::string Appender::_name [private] |
Definition at line 147 of file Appender.hh.