Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

log4cpp::Appender Class Reference

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

#include <Appender.hh>

Inheritance diagram for log4cpp::Appender:

Inheritance graph
[legend]
List of all members.

Public Methods

virtual ~Appender ()
 Destructor for Appender.

virtual void doAppend (const LoggingEvent &event)=0
 Log in Appender specific way.

virtual bool reopen ()=0
 Reopens the output destination of this Appender, e.g.

virtual void close ()=0
 Release any resources allocated within the appender such as file handles, network connections, etc.

virtual bool requiresLayout () const=0
 Check if the appender uses a layout.

virtual void setLayout (Layout *layout)=0
 Set the Layout for this appender.

const std::string & getName () const
 Get the name of this appender.

virtual void setThreshold (Priority::Value priority)=0
 Set the threshold priority of this Appender.

virtual Priority::Value getThreshold ()=0
 Get the threshold priority of this Appender.

virtual void setFilter (Filter *filter)=0
 Set a Filter for this appender.

virtual FiltergetFilter ()=0
 Get the Filter for this appender.


Static Public Methods

Appender * getAppender (const std::string &name)
 Get a pointer to an exitsing Appender.

bool reopenAll ()
 Call reopen() on all existing Appenders.

void closeAll ()
 Call reopen() on all existing Appenders.


Protected Methods

 Appender (const std::string &name)
 Constructor for Appender.


Friends

class log4cpp::Log4cppCleanup

Detailed Description

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


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:
name  The name of this Appender.

log4cpp::Appender::~Appender   [virtual]
 

Destructor for Appender.


Member Function Documentation

virtual void log4cpp::Appender::close   [pure virtual]
 

Release any resources allocated within the appender such as file handles, network connections, etc.

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

void log4cpp::Appender::closeAll   [static]
 

Call reopen() on all existing Appenders.

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

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

Log in Appender specific way.

Parameters:
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.

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

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.

virtual Priority::Value log4cpp::Appender::getThreshold   [pure virtual]
 

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::AppenderSkeleton, log4cpp::FileAppender, log4cpp::IdsaAppender, log4cpp::OstreamAppender, log4cpp::RemoteSyslogAppender, log4cpp::StringQueueAppender, and log4cpp::SyslogAppender.

bool log4cpp::Appender::reopenAll   [static]
 

Call reopen() on all existing Appenders.

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

virtual bool log4cpp::Appender::requiresLayout   [pure virtual]
 

Check if the appender uses a layout.

Returns:
true if the appender implementation requires a layout.

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

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:
layout  The layout to use.

Implemented in log4cpp::AppenderSkeleton, log4cpp::IdsaAppender, 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:
priority  The priority to set.

Implemented in log4cpp::AppenderSkeleton.


Friends And Related Function Documentation

friend class log4cpp::Log4cppCleanup [friend]
 


The documentation for this class was generated from the following files:
Generated on Fri May 9 10:39:59 2003 for log4cpp by doxygen1.2.18