log4shib 2.0.0

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
log4shib::PropertyConfiguratorImpl Class Reference

`#include <PropertyConfiguratorImpl.hh>`

Collaboration diagram for log4shib::PropertyConfiguratorImpl:
[legend]

## Public Types
typedef std::map< std::string, Appender * > | AppenderMap

## Public Member Functions
| PropertyConfiguratorImpl ()
virtual | ~PropertyConfiguratorImpl ()
virtual void | doConfigure (const std::string &initFileName) throw (ConfigureFailure)
virtual void | doConfigure (std::istream &in) throw (ConfigureFailure)

## Protected Member Functions
void | configureCategory (const std::string &categoryname) throw (ConfigureFailure)
| configure the given category. More...
void | getCategories (std::vector< std::string > &categories) const
| Get a list of categories for which we should do the configuration. More...
void | instantiateAllAppenders () throw (ConfigureFailure)
Appender * | instantiateAppender (const std::string &name)
| Intantiate and configure the appender referred to by the given name. More...
void | setLayout (Appender *appender, const std::string &name)
| Method for instantiating and configuring the layouts associated with each appender. More...

## Protected Attributes
Properties | _properties
AppenderMap | _allAppenders

## Member Typedef Documentation

## ◆ AppenderMap

typedef std::map<std::string, Appender*> log4shib::PropertyConfiguratorImpl::AppenderMap

## Constructor & Destructor Documentation

## ◆ PropertyConfiguratorImpl()

log4shib::PropertyConfiguratorImpl::PropertyConfiguratorImpl | ( |  | ) |

## ◆ ~PropertyConfiguratorImpl()

log4shib::PropertyConfiguratorImpl::~PropertyConfiguratorImpl | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ configureCategory()

void log4shib::PropertyConfiguratorImpl::configureCategory | ( | const std::string & | categoryname | ) |
throw | ( | ConfigureFailure
| ) |  |
| protected

configure the given category.

This includes setting its Priority and adding any Appenders.

Todo:
  setting other properties like 'additivity'.

Parameters

  categoryname | Name of the category to configure. The name 'rootCategory' refers to the root Category. throw ConfigureFailure

## ◆ doConfigure() [1/2]

void log4shib::PropertyConfiguratorImpl::doConfigure | ( | const std::string & | initFileName | ) |
throw | ( | ConfigureFailure
| ) |  |
| virtual

## ◆ doConfigure() [2/2]

void log4shib::PropertyConfiguratorImpl::doConfigure | ( | std::istream & | in | ) |
throw | ( | ConfigureFailure
| ) |  |
| virtual

## ◆ getCategories()

void log4shib::PropertyConfiguratorImpl::getCategories | ( | std::vector< std::string > & | categories | ) | const
| protected

Get a list of categories for which we should do the configuration.

Get the categories contained within the map of properties.

This simply extracts the categories from the map.

Parameters

  categories | Reference to a list which is to receive the list of categories.

Since the category looks something like "category.xxxxx.yyy.zzz", we need to search the entire map to figure out which properties are category listings. Seems like there might be a more elegant solution.

## ◆ instantiateAllAppenders()

void log4shib::PropertyConfiguratorImpl::instantiateAllAppenders | ( |  | ) |
throw | ( | ConfigureFailure
| ) |  |
| protected

## ◆ instantiateAppender()

Appender * log4shib::PropertyConfiguratorImpl::instantiateAppender | ( | const std::string & | name | ) |
| protected

Intantiate and configure the appender referred to by the given name.

This method searches the map to find all configuration parameters for the appender, and adds the appender to the given category. This isn't very general in the sense that it will need to be modified for each type of appender and layout. A more general solution would be to define an "options" interface for each appender and layout, so that we can simply call this method with a list of options instead of needing to know what is or is not available. This would also require some generic way of instantiating an object for which we have no knowledge. An "AppenderFactory" could be used which maps the given type to an actual object class registered with the factory (?? is this possible?).

Parameters

  name | String containing the name of the type of appender to be instantiated.

## ◆ setLayout()

void log4shib::PropertyConfiguratorImpl::setLayout | ( | Appender * | appender,
|  | const std::string & | name
| ) |  |
| protected

Method for instantiating and configuring the layouts associated with each appender.

Parameters

  appender | Appender to which we are setting this layout.
  name | Name in the properties of this appender.

## Member Data Documentation

## ◆ _allAppenders

AppenderMap log4shib::PropertyConfiguratorImpl::_allAppenders
| protected

## ◆ _properties

Properties log4shib::PropertyConfiguratorImpl::_properties
| protected

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

- PropertyConfiguratorImpl.hh
- PropertyConfiguratorImpl.cpp