Apache Log4cxx  Version 2.0.0
Loading...
Searching...
No Matches
log4cxx::spi::Configurator Class Referenceabstract

An abstract base for classes capable of configuring Log4cxx. More...

#include <configurator.h>

Inheritance diagram for log4cxx::spi::Configurator:
log4cxx::helpers::Object log4cxx::PropertyConfigurator log4cxx::xml::DOMConfigurator

Public Member Functions

virtual bool isValid (const File &configFileName)=0
 Does configFileName contain directives that this class uses?
virtual ConfigurationStatus doConfigure (const File &configFileName, const spi::LoggerRepositoryPtr &target={})=0
 Apply the directives in configFileName to target.
Public Member Functions inherited from log4cxx::helpers::Object
virtual ~Object ()
virtual const helpers::Class & getClass () const =0
virtual bool instanceof (const Class &clazz) const =0
virtual const void * cast (const Class &clazz) const =0

Static Public Member Functions

static helpers::Properties & properties ()
 The key value pairs used when expanding ${varname} instances in a configuration file.

Protected Member Functions

 Configurator ()

Detailed Description

An abstract base for classes capable of configuring Log4cxx.

Constructor & Destructor Documentation

◆ Configurator()

log4cxx::spi::Configurator::Configurator ( )
protected

Member Function Documentation

◆ doConfigure()

virtual ConfigurationStatus log4cxx::spi::Configurator::doConfigure ( const File & configFileName,
const spi::LoggerRepositoryPtr & target = {} )
pure virtual

Apply the directives in configFileName to target.

If target is not provided, the spi::LoggerRepository held by LogManager is used.

The existing configuration is not cleared nor reset. If you require a different behavior, call resetConfiguration before calling doConfigure.

Parameters
configFileNameThe file to parse
targetHolds the Logger instances.

Implemented in log4cxx::PropertyConfigurator, and log4cxx::xml::DOMConfigurator.

◆ isValid()

virtual bool log4cxx::spi::Configurator::isValid ( const File & configFileName)
pure virtual

Does configFileName contain directives that this class uses?

Parameters
configFileNameThe file to examine

Implemented in log4cxx::PropertyConfigurator, and log4cxx::xml::DOMConfigurator.

◆ properties()

helpers::Properties & log4cxx::spi::Configurator::properties ( )
static

The key value pairs used when expanding ${varname} instances in a configuration file.

By default, the map holds the currently executing program file path and the std::filesystem::path decomposition of the currently executing program file path, using the variable names:

  • PROGRAM_FILE_PATH
  • PROGRAM_FILE_PATH.ROOT_NAME
  • PROGRAM_FILE_PATH.ROOT_DIRECTORY
  • PROGRAM_FILE_PATH.ROOT_PATH
  • PROGRAM_FILE_PATH.RELATIVE_PATH
  • PROGRAM_FILE_PATH.PARENT_PATH
  • PROGRAM_FILE_PATH.FILENAME
  • PROGRAM_FILE_PATH.STEM
  • PROGRAM_FILE_PATH.EXTENSION
Warning
This method is not thread-safe. Only add entries during initialization.
Returns
a mutable map - modification and use must be confined to a single thread.
Examples
com/foo/config4.cpp.

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