|
Apache Log4cxx
Version 2.0.0
|
A LoggerRepository is used to create and retrieve Loggers.
More...
#include <loggerrepository.h>
Public Member Functions | |
| virtual | ~LoggerRepository () |
| virtual void | addHierarchyEventListener (const HierarchyEventListenerPtr &listener)=0 |
Add listener to the repository. | |
| virtual void | removeHierarchyEventListener (const spi::HierarchyEventListenerPtr &listener)=0 |
Remove listener from the repository. | |
| virtual void | ensureIsConfigured (std::function< void()> configurator)=0 |
Call configurator if not yet configured and configurator has not already been tried. | |
| virtual bool | isDisabled (int level) const =0 |
Is the repository disabled for level? | |
| virtual void | setThreshold (const LevelPtr &newLevel)=0 |
Enable logging for logging requests with level newLevel or higher. | |
| virtual void | setThreshold (const LogString &newLevel)=0 |
Enable logging for logging requests with level newLevel or higher. | |
| virtual void | emitNoAppenderWarning (const Logger *logger)=0 |
Add a warning to internal debug output that logger does not have any Appender attached. | |
| virtual LevelPtr | getThreshold () const =0 |
| The current repository-wide threshold. | |
| virtual LoggerPtr | getLogger (const LogString &name, const spi::LoggerFactoryPtr &factory={})=0 |
Retrieve the name Logger instance. | |
| virtual bool | removeLogger (const LogString &name, bool ifNotUsed=true)=0 |
Remove the name Logger from the repository. | |
| virtual LoggerPtr | getRootLogger () const =0 |
| The logger that cannot be retrieved by name. | |
| virtual LoggerPtr | exists (const LogString &name)=0 |
Does name exist in the repository? | |
| virtual void | shutdown ()=0 |
| Close and remove all appenders in all categories including the root logger. | |
| virtual LoggerList | getCurrentLoggers () const =0 |
| All the loggers currently defined in this repository. | |
| virtual void | fireAddAppenderEvent (const Logger *logger, const Appender *appender) |
| Call addAppenderEvent on all registered listeners. | |
| virtual void | fireRemoveAppenderEvent (const Logger *logger, const Appender *appender) |
| Call removeAppenderEvent on all registered listeners. | |
| virtual void | resetConfiguration ()=0 |
| Reset all values contained in this repository instance to their default. | |
| virtual bool | isConfigured ()=0 |
| The value of the configured status. | |
| virtual void | setConfigured (bool configured)=0 |
Set the configured status to true. | |
| virtual void | updateChildren (const Logger *parent)=0 |
Refresh the configuration of all loggers where parent is somewhere in their ancestor chain. | |
| 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 |
A LoggerRepository is used to create and retrieve Loggers.
The relation between loggers in a repository depends on the repository but typically loggers are arranged in a named hierarchy.
In addition to the creational methods, a LoggerRepository can be queried for existing loggers, can act as a point of registry for events related to loggers.
|
virtual |
|
pure virtual |
Add listener to the repository.
|
pure virtual |
Add a warning to internal debug output that logger does not have any Appender attached.
To avoid overloading the output stream, the warning is emitted only once.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Call configurator if not yet configured and configurator has not already been tried.
If configurator succeeds, it must call LoggerRepository::setConfigured to ensure subsequent calls to LoggerRepository::ensureIsConfigured from overwriting the configuration.
Implemented in log4cxx::Hierarchy.
Does name exist in the repository?
name exists in the repository. Implemented in log4cxx::Hierarchy.
|
virtual |
Call addAppenderEvent on all registered listeners.
Reimplemented in log4cxx::Hierarchy.
|
virtual |
Call removeAppenderEvent on all registered listeners.
Reimplemented in log4cxx::Hierarchy.
|
pure virtual |
All the loggers currently defined in this repository.
The root logger is not included in the returned LoggerList.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Retrieve the name Logger instance.
If a logger of that name already exists, it will be returned. Otherwise, a new logger will be instantiated, optionally by calling factory->makeNewLoggerInstance().
| name | The logger to retrieve. |
| factory | If provided, used to instantiate a new logger. |
Implemented in log4cxx::Hierarchy.
|
pure virtual |
The logger that cannot be retrieved by name.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
The current repository-wide threshold.
See setThreshold for an explanation.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
The value of the configured status.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Is the repository disabled for level?
The answer depends on the repository threshold and the level parameter. See also the setThreshold method.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Remove listener from the repository.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Remove the name Logger from the repository.
Note: The name Logger must be retrieved from the repository after any subsequent configuration file change for the newly loaded settings to be used.
| name | The logger to remove. |
| ifNotUsed | If true and use_count() indicates there are other references, do not remove the Logger and return false. |
name Logger was removed from the repository. Implemented in log4cxx::Hierarchy.
|
pure virtual |
Reset all values contained in this repository instance to their default.
This removes all appenders from all categories, sets the level of all non-root categories to null, sets their additivity flag to true and sets the level of the root logger to DEBUG. Also the repository wide threshold is set its default "ALL" value.
Existing categories are not removed.
This method should be used sparingly and with care as it will block all logging until this is configured again.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Set the configured status to true.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Enable logging for logging requests with level newLevel or higher.
All logging requests below the threshold are immediately dropped. By default, the threshold is set to Level::getAll() which has the lowest possible rank.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Enable logging for logging requests with level newLevel or higher.
The threshold is set the DEBUG if newLevel is not recognised by Level::getLevel. All logging requests below the threshold are immediately dropped. By default, the threshold is set to Level::getAll() which has the lowest possible rank.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Close and remove all appenders in all categories including the root logger.
The configured status becomes false.
Implemented in log4cxx::Hierarchy.
|
pure virtual |
Refresh the configuration of all loggers where parent is somewhere in their ancestor chain.
The ancestor chain ends at the root logger.
Implemented in log4cxx::Hierarchy.