log4shib::FixedContextCategory(3)

NAME
log4shib::FixedContextCategory - This Category subclass replaces the NDC field in LoggingEvents with a fixed context string.

SYNOPSIS

#include <FixedContextCategory.hh>

Inherits log4shib::Category.

  Public Member Functions
FixedContextCategory (const std::string &name, const std::string &context='')
Constructor.
virtual ~FixedContextCategory ()
Destructor for Category.
virtual void setContext (const std::string &context)
Set the context string used as NDC.
virtual std::string getContext () const
Return the context string used as NDC.
virtual Priority::Value getPriority () const throw ()
Returns the assigned Priority, if any, for this Category.
virtual Priority::Value getChainedPriority () const throw ()
Starting from this Category, search the category hierarchy for a set priority and return it.
virtual void addAppender (Appender *appender) throw ()
For the moment this method does nothing.
virtual void addAppender (Appender &appender)
For the moment this method does nothing.
virtual Appender * getAppender () const
Returns the Appender for this Category, or NULL if no Appender has been set.
virtual Appender * getAppender (const std::string &name) const
Returns the specified Appender for this Category, or NULL if the Appender is not attached to this Category.
virtual AppenderSet getAllAppenders () const
Returns the set of Appenders currently attached to this Catogory.
virtual void removeAllAppenders ()
Removes all appenders set for this Category.
virtual bool ownsAppender (Appender *appender) const throw ()
FixedContextAppenders cannot own Appenders.
virtual void callAppenders (const LoggingEvent &event) throw ()
Call the appenders in the hierarchy starting at this.
virtual void setAdditivity (bool additivity)
Set the additivity flag for this Category instance.
virtual bool getAdditivity () const throw ()
Returns the additivity flag for this Category instance.

  Protected Member Functions
virtual void _logUnconditionally2 (Priority::Value priority, const std::string &message) throw ()
Unconditionally log a message with the specified priority.

  Additional Inherited Members

Detailed Description

This Category subclass replaces the NDC field in LoggingEvents with a fixed context string. All handling of Appenders, etc. is delgated to the 'normal' Category with the same name. Its intended use is for object instances that serve a single client: they contruct a FixedContextCategory with the client identifier as context. Unlike with regular Category instances one has to explicitly create FixedContextCategory instances using the constructor. This also implies one has to take cake of destruction of the instance as well.

Since
    0.2.4

Constructor & Destructor Documentation

  log4shib::FixedContextCategory::FixedContextCategory (const std::string & name, const std::string & context = '')

Constructor.

Parameters
    name the fully qualified name of this Categories delegate Category.
    context the context to fill the NDC field of LoggingEvents with.

  log4shib::FixedContextCategory::~FixedContextCategory () [virtual]

Destructor for Category.

Member Function Documentation

  void log4shib::FixedContextCategory::_logUnconditionally2 (Priority::Value priority, const std::string & message) [protected], [virtual]

Unconditionally log a message with the specified priority.

Parameters
    priority The priority of this log message.
    message string to write in the log file

Reimplemented from log4shib::Category.

  void log4shib::FixedContextCategory::addAppender (Appender & appender) [virtual]

For the moment this method does nothing.

Reimplemented from log4shib::Category.

  void log4shib::FixedContextCategory::addAppender (Appender * appender) [virtual]

For the moment this method does nothing.

Reimplemented from log4shib::Category.

  void log4shib::FixedContextCategory::callAppenders (const LoggingEvent & event) [virtual]

Call the appenders in the hierarchy starting at this. If no appenders could be found, emit a warning.

This method always calls all the appenders inherited form the hierracy circumventing any evaluation of whether to log or not to log the particular log request.

Parameters
    event The LoggingEvent to log.

Reimplemented from log4shib::Category.

  bool log4shib::FixedContextCategory::getAdditivity () const [virtual]

Returns the additivity flag for this Category instance.

Reimplemented from log4shib::Category.

  AppenderSet log4shib::FixedContextCategory::getAllAppenders () const [virtual]

Returns the set of Appenders currently attached to this Catogory.

Since
    0.3.1

Returns
    The set of attached Appenders.

Reimplemented from log4shib::Category.

  Appender * log4shib::FixedContextCategory::getAppender () const [virtual]

Returns the Appender for this Category, or NULL if no Appender has been set.

Returns
    The Appender.

Reimplemented from log4shib::Category.

  Appender * log4shib::FixedContextCategory::getAppender (const std::string & name) const [virtual]

Returns the specified Appender for this Category, or NULL if the Appender is not attached to this Category.

Since
    0.2.7

Returns
    The Appender.

Reimplemented from log4shib::Category.

  Priority::Value log4shib::FixedContextCategory::getChainedPriority () const [virtual]

Starting from this Category, search the category hierarchy for a set priority and return it. Otherwise, return the priority of the root category.

The Category class is designed so that this method executes as quickly as possible.

Reimplemented from log4shib::Category.

  std::string log4shib::FixedContextCategory::getContext () const [virtual]

Return the context string used as NDC.

Returns
    the context string.

  Priority::Value log4shib::FixedContextCategory::getPriority () const [virtual]

Returns the assigned Priority, if any, for this Category.

Returns
    Priority - the assigned Priority, can be Priority::NOTSET

Reimplemented from log4shib::Category.

  bool log4shib::FixedContextCategory::ownsAppender (Appender * appender) const [virtual]

FixedContextAppenders cannot own Appenders.

Returns
    false

Reimplemented from log4shib::Category.

  void log4shib::FixedContextCategory::removeAllAppenders () [virtual]

Removes all appenders set for this Category. Currently a Category can have only one appender, but this may change in the future.

Reimplemented from log4shib::Category.

  void log4shib::FixedContextCategory::setAdditivity (bool additivity) [virtual]

Set the additivity flag for this Category instance.

Reimplemented from log4shib::Category.

  void log4shib::FixedContextCategory::setContext (const std::string & context) [virtual]

Set the context string used as NDC.

Parameters
    context the context string

Author

Generated automatically by Doxygen for log4shib from the source code.