|
Apache Log4cxx
Version 2.0.0
|
Allows Loggers, Appenders, Layouts and Filters to be set up using directives in a XML format file. More...
#include <domconfigurator.h>
Public Member Functions | |
| DOMConfigurator () | |
| ~DOMConfigurator () | |
| bool | isValid (const File &configFileName) override |
Does configFileName contain directives that this class uses? | |
| spi::ConfigurationStatus | doConfigure (const File &configFileName, const spi::LoggerRepositoryPtr &target={}) override |
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 spi::ConfigurationStatus | configure (const File &configFilename) |
Apply the directives in configFileName to the spi::LoggerRepository held by LogManager. | |
| static spi::ConfigurationStatus | configureAndWatch (const File &configFilename, long millisecondDelay=0) |
Apply the directives in configFileName to the spi::LoggerRepository held by LogManager. | |
| Static Public Member Functions inherited from log4cxx::spi::Configurator | |
| static helpers::Properties & | properties () |
| The key value pairs used when expanding ${varname} instances in a configuration file. | |
Additional Inherited Members | |
| Protected Member Functions inherited from log4cxx::spi::Configurator | |
| Configurator () | |
Allows Loggers, Appenders, Layouts and Filters to be set up using directives in a XML format file.
Use Log4cxx internal logging to see values read by Log4cxx. You can enable Log4cxx internal logging by setting the debug attribute in the log4j:configuration element. As in
<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
...
</log4j:configuration>
There are sample XML files included in the Configuration Files and in the Log4cxx Examples.
| log4cxx::xml::DOMConfigurator::DOMConfigurator | ( | ) |
| log4cxx::xml::DOMConfigurator::~DOMConfigurator | ( | ) |
|
static |
Apply the directives in configFileName to the spi::LoggerRepository held by LogManager.
Pre-existing key-value pairs in the property map provided by spi::Configurator::properties() are used when expanding ${varname} instances in configFileName.
The existing configuration is not cleared nor reset. If you require a different behavior, call resetConfiguration before calling doConfigure.
|
static |
Apply the directives in configFileName to the spi::LoggerRepository held by LogManager.
Pre-existing key-value pairs in the property map provided by spi::Configurator::properties() are used when expanding ${varname} instances in configFileName.
The existing configuration is not cleared nor reset. If you require a different behavior, call resetConfiguration before calling doConfigure.
A task will be created that periodically checks whether configFilename has been created or modified. A period of log4cxx::helpers::FileWatchdog::DEFAULT_DELAY is used if delay is not a positive number. If a change or file creation is detected, then configFilename is read to configure Log4cxx.
The task will be stopped by a LogManager::shutdown call.
| configFilename | A XML format file. |
| millisecondDelay | The duration to wait between each check. |
|
overridevirtual |
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.
| configFileName | The file to parse |
| target | Holds the Logger instances. |
Pre-existing key-value pairs in the property map provided by spi::Configurator::properties() are used when expanding ${varname} instances in configFileName.
Implements log4cxx::spi::Configurator.
|
overridevirtual |
Does configFileName contain directives that this class uses?
| configFileName | The file to examine |
This implementation checks configFileName is a valid XML file and that the root element name is either "log4j:configuration" or "configuration".
Implements log4cxx::spi::Configurator.