log4shib 2.0.0

Public Member Functions | Protected Member Functions | List of all members
log4shib::AppenderSkeleton Class Referenceabstract

AppenderSkeleton is a helper class, simplifying implementation of Appenders: it already takes care of handling of Thresholds and Filters. More...

`#include <AppenderSkeleton.hh>`

Inheritance diagram for log4shib::AppenderSkeleton:
[legend]
Collaboration diagram for log4shib::AppenderSkeleton:
[legend]

## Public Member Functions
virtual | ~AppenderSkeleton ()
| Destructor for AppenderSkeleton. More...
virtual void | doAppend (const LoggingEvent &event)
| Log in Appender specific way. More...
virtual bool | reopen ()
| Reopens the output destination of this Appender, e.g. More...
virtual void | close ()=0
| Release any resources allocated within the appender such as file handles, network connections, etc. More...
virtual bool | requiresLayout () const =0
| Check if the appender uses a layout. More...
virtual void | setLayout (Layout *layout)=0
| Set the Layout for this appender. More...
virtual void | setThreshold (Priority::Value priority)
| Set the threshold priority of this Appender. More...
virtual Priority::Value | getThreshold ()
| Get the threshold priority of this Appender. More...
virtual void | setFilter (Filter *filter)
| Set a Filter for this appender. More...
virtual Filter * | getFilter ()
| Get the Filter for this appender. More...
Public Member Functions inherited from log4shib::Appender
virtual | ~Appender ()
| Destructor for Appender. More...
virtual void | doAppend (const LoggingEvent &event)=0
| Log in Appender specific way. More...
virtual bool | reopen ()=0
| Reopens the output destination of this Appender, e.g. More...
virtual void | close ()=0
| Release any resources allocated within the appender such as file handles, network connections, etc. More...
virtual bool | requiresLayout () const =0
| Check if the appender uses a layout. More...
virtual void | setLayout (Layout *layout)=0
| Set the Layout for this appender. More...
const std::string & | getName () const
| Get the name of this appender. More...
virtual void | setThreshold (Priority::Value priority)=0
| Set the threshold priority of this Appender. More...
virtual Priority::Value | getThreshold ()=0
| Get the threshold priority of this Appender. More...
virtual void | setFilter (Filter *filter)=0
| Set a Filter for this appender. More...
virtual Filter * | getFilter ()=0
| Get the Filter for this appender. More...

## Protected Member Functions
| AppenderSkeleton (const std::string &name)
| Constructor for AppenderSkeleton. More...
virtual void | _append (const LoggingEvent &event)=0
| Log in Appender specific way. More...
Protected Member Functions inherited from log4shib::Appender
| Appender (const std::string &name)
| Constructor for Appender. More...

## Additional Inherited Members
Static Public Member Functions inherited from log4shib::Appender
static Appender * | getAppender (const std::string &name)
| Get a pointer to an exitsing Appender. More...
static bool | reopenAll ()
| Call reopen() on all existing Appenders. More...
static void | closeAll ()
| Call reopen() on all existing Appenders. More...

## Detailed Description

AppenderSkeleton is a helper class, simplifying implementation of Appenders: it already takes care of handling of Thresholds and Filters.

## Constructor & Destructor Documentation

## ◆ AppenderSkeleton()

log4shib::AppenderSkeleton::AppenderSkeleton | ( | const std::string & | name | ) |
| protected

Constructor for AppenderSkeleton.

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

Parameters

  name | The name of this Appender.

## ◆ ~AppenderSkeleton()

log4shib::AppenderSkeleton::~AppenderSkeleton | ( |  | ) |
| virtual

Destructor for AppenderSkeleton.

## Member Function Documentation

## ◆ _append()

virtual void log4shib::AppenderSkeleton::_append | ( | const LoggingEvent & | event | ) |
| protected pure virtual

Log in Appender specific way.

Subclasses of Appender should implement this method to perform actual logging.

Parameters

  event | The LoggingEvent to log.

Implemented in log4shib::AbortAppender, log4shib::FileAppender, log4shib::IdsaAppender, log4shib::NTEventLogAppender, log4shib::OstreamAppender, log4shib::RemoteSyslogAppender, log4shib::RollingFileAppender, log4shib::StringQueueAppender, log4shib::SyslogAppender, and log4shib::Win32DebugAppender.

## ◆ close()

virtual void log4shib::AppenderSkeleton::close | ( |  | ) |
| pure virtual

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

Implements log4shib::Appender.

Implemented in log4shib::AbortAppender, log4shib::FileAppender, log4shib::IdsaAppender, log4shib::NTEventLogAppender, log4shib::OstreamAppender, log4shib::RemoteSyslogAppender, log4shib::StringQueueAppender, log4shib::SyslogAppender, and log4shib::Win32DebugAppender.

## ◆ doAppend()

void log4shib::AppenderSkeleton::doAppend | ( | const LoggingEvent & | event | ) |
| virtual

Log in Appender specific way.

Parameters

  event | The LoggingEvent to log.

Implements log4shib::Appender.

## ◆ getFilter()

Filter * log4shib::AppenderSkeleton::getFilter | ( |  | ) |
| virtual

Get the Filter for this appender.

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

Implements log4shib::Appender.

## ◆ getThreshold()

Priority::Value log4shib::AppenderSkeleton::getThreshold | ( |  | ) |
| virtual

Get the threshold priority of this Appender.

Returns
  the threshold

Implements log4shib::Appender.

## ◆ reopen()

bool log4shib::AppenderSkeleton::reopen | ( |  | ) |
| 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.

Implements log4shib::Appender.

Reimplemented in log4shib::AbortAppender, log4shib::FileAppender, log4shib::IdsaAppender, log4shib::NTEventLogAppender, log4shib::OstreamAppender, log4shib::RemoteSyslogAppender, log4shib::StringQueueAppender, and log4shib::SyslogAppender.

## ◆ requiresLayout()

virtual bool log4shib::AppenderSkeleton::requiresLayout | ( |  | ) | const
| pure virtual

Check if the appender uses a layout.

Returns
  true if the appender implementation requires a layout.

Implements log4shib::Appender.

Implemented in log4shib::AbortAppender, log4shib::IdsaAppender, and log4shib::LayoutAppender.

## ◆ setFilter()

void log4shib::AppenderSkeleton::setFilter | ( | Filter * | filter | ) |
| virtual

Set a Filter for this appender.

Implements log4shib::Appender.

## ◆ setLayout()

virtual void log4shib::AppenderSkeleton::setLayout | ( | Layout * | layout | ) |
| pure virtual

Set the Layout for this appender.

Parameters

  layout | The layout to use.

Implements log4shib::Appender.

Implemented in log4shib::AbortAppender, log4shib::IdsaAppender, and log4shib::LayoutAppender.

## ◆ setThreshold()

void log4shib::AppenderSkeleton::setThreshold | ( | Priority::Value | priority | ) |
| 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.

Implements log4shib::Appender.

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

- AppenderSkeleton.hh
- AppenderSkeleton.cpp