|
Apache Log4cxx
Version 2.0.0
|
Use this class to initialize the log4cxx environment using a DOM tree. More...
#include <domconfigurator.h>
Public Member Functions | |
| ~DOMConfigurator () | |
| DOMConfigurator () | |
| spi::ConfigurationStatus | doConfigure (const File &filename, const spi::LoggerRepositoryPtr &repository=spi::LoggerRepositoryPtr()) override |
Interpret filename as an XML file and set up Log4cxx accordingly. | |
| 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) |
Read configuration options from configFilename. | |
| static spi::ConfigurationStatus | configureAndWatch (const File &configFilename, long delay=0) |
Read configuration options from configFilename (if it exists). | |
| 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 () | |
Use this class to initialize the log4cxx environment using a DOM tree.
Sometimes it is useful to see how log4cxx is reading configuration files. You can enable log4cxx internal logging by setting the debug attribute in the log4cxx element. As in
<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
...
</log4j:configuration>
There are sample XML files included in the package.
| log4cxx::xml::DOMConfigurator::~DOMConfigurator | ( | ) |
| log4cxx::xml::DOMConfigurator::DOMConfigurator | ( | ) |
|
static |
Read configuration options from configFilename.
Stores Logger instances in the spi::LoggerRepository held by LogManager.
|
static |
Read configuration options from configFilename (if it exists).
A thread 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 thread will be stopped by a LogManager::shutdown call.
| configFilename | A XML format file. |
| delay | The delay in milliseconds to wait between each check. |
|
overridevirtual |
Interpret filename as an XML file and set up Log4cxx accordingly.
If repository 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.
| filename | The file to parse. |
| repository | Where the Logger instances reside. |
Implements log4cxx::spi::Configurator.