#include <Appender.hh>
Public Member Functions | |
virtual void | close ()=0 |
virtual void | doAppend (const LoggingEvent &event)=0 |
virtual Filter * | getFilter ()=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 Appender * | getAppender (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 |
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*> log4cpp::Appender::AppenderMap [private] |
Definition at line 134 of file Appender.hh.
log4cpp::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. |
Definition at line 72 of file Appender.cpp.
log4cpp::Appender::~Appender | ( | ) | [virtual] |
Destructor for Appender.
Definition at line 77 of file Appender.cpp.
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.
Appender::AppenderMap & log4cpp::Appender::_getAllAppenders | ( | ) | [static, private] |
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] |
Release any resources allocated within the appender such as file handles, network connections, etc.
Implemented in log4cpp::RemoteSyslogAppender, log4cpp::AppenderSkeleton, log4cpp::SyslogAppender, log4cpp::FileAppender, log4cpp::IdsaAppender, log4cpp::StringQueueAppender, log4cpp::AbortAppender, log4cpp::OstreamAppender, and log4cpp::BufferingAppender.
void log4cpp::Appender::closeAll | ( | ) | [static] |
Call reopen() on all existing Appenders.
Definition at line 54 of file Appender.cpp.
virtual void log4cpp::Appender::doAppend | ( | const LoggingEvent & | event | ) | [pure virtual] |
Log in Appender specific way.
event | The LoggingEvent to log. |
Implemented in log4cpp::AppenderSkeleton.
Appender * log4cpp::Appender::getAppender | ( | const std::string & | name | ) | [static] |
Get a pointer to an exitsing Appender.
name | The name of the Appender to return. |
Definition at line 25 of file Appender.cpp.
virtual Filter* log4cpp::Appender::getFilter | ( | ) | [pure virtual] |
Get the Filter for this appender.
Implemented in log4cpp::AppenderSkeleton.
const std::string& log4cpp::Appender::getName | ( | ) | const [inline] |
Get the name of this appender. The name identifies the appender.
Definition at line 106 of file Appender.hh.
virtual Priority::Value log4cpp::Appender::getThreshold | ( | ) | [pure virtual] |
Get the threshold priority of this Appender.
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.
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.
Definition at line 43 of file Appender.cpp.
virtual bool log4cpp::Appender::requiresLayout | ( | ) | const [pure virtual] |
Check if the appender uses 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.
layout | The 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.
priority | The priority to set. |
Implemented in log4cpp::AppenderSkeleton.
Appender::AppenderMap * log4cpp::Appender::_allAppenders = 0 [static, private] |
Definition at line 136 of file Appender.hh.
threading::Mutex log4cpp::Appender::_appenderMapMutex [static, private] |
Definition at line 137 of file Appender.hh.
const std::string log4cpp::Appender::_name [private] |
Definition at line 144 of file Appender.hh.