This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy. More...
#include <hierarchy.h>
configurator if not yet configured. setThreshold . newLevel or higher. true if this repository is disabled for level object passed as parameter and false otherwise. HierarchyEventListener event to the repository. configurator if not yet configured. level parameter. This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.
The casual user does not have to deal with this class directly.
The structure of the logger hierarchy is maintained by the getLogger method. The hierarchy is such that children link to their parent but parents do not have any pointers to their children. Moreover, loggers can be instantiated in any order, in particular descendant before ancestor.
In case a descendant is created before a particular ancestor, then it creates a provision node for the ancestor and adds itself to the provision node. Other descendants of the same ancestor add themselves to the previously created provision node.
This call will clear all logger definitions from the internal hashtable.
Invoking this method will irrevocably mess up the logger hierarchy.
You should really know what you are doing before invoking this method.
Implements log4cxx::spi::LoggerRepository.
Call configurator if not yet configured.
Implements log4cxx::spi::LoggerRepository.
Check if the named logger exists in the hierarchy.
If so return its reference, otherwise returns null.
Implements log4cxx::spi::LoggerRepository.
Reimplemented from log4cxx::spi::LoggerRepository.
Reimplemented from log4cxx::spi::LoggerRepository.
Returns all the currently defined loggers in this hierarchy as a LoggerList.
The root logger is not included in the returned LoggerList.
Implements log4cxx::spi::LoggerRepository.
Retrieve the name Logger instance using the default factory to create it if required.
If a logger of that name already exists, then it will be returned. Otherwise, a new logger will be instantiated and then linked with its existing ancestors as well as children.
Implements log4cxx::spi::LoggerRepository.
Retrieve the name Logger instance using factory to create it if required.
If a logger of that name already exists, then it will be returned. Otherwise, a new logger will be instantiated by the factory parameter and linked with its existing ancestors as well as children.
Implements log4cxx::spi::LoggerRepository.
Get the root of this hierarchy.
Implements log4cxx::spi::LoggerRepository.
Returns a Level representation of the enable state.
Implements log4cxx::spi::LoggerRepository.
Implements log4cxx::spi::LoggerRepository.
This method will return true if this repository is disabled for level object passed as parameter and false otherwise.
See also the setThreshold method.
Implements log4cxx::spi::LoggerRepository.
Remove a previously added HierarchyEventListener.
Remove the name Logger from the hierarchy.
Note: The name Logger must be retrieved from the hierarchy after any subsequent configuration file change for the newly loaded settings to be used.
name Logger was removed from the hierarchy. Reset all values contained in this hierarchy 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. Moreover, message disabling is set its default "off" value.
Existing categories are not removed. They are just reset.
This method should be used sparingly and with care as it will block all logging until it is completed.
Implements log4cxx::spi::LoggerRepository.
Implements log4cxx::spi::LoggerRepository.
Enable logging for logging requests with level newLevel or higher.
By default all levels are enabled.
Implements log4cxx::spi::LoggerRepository.
The string form of setThreshold .
Implements log4cxx::spi::LoggerRepository.
Used by subclasses to add a renderer to the hierarchy passed as parameter.
Shutting down a hierarchy will safely close and remove all appenders in all categories including the root logger.
Some appenders such as XMLSocketAppender and AsyncAppender need to be closed before the application exists. Otherwise, pending logging events might be lost.
The shutdown method is careful to close nested appenders before closing regular appenders. This is allows configurations where a regular appender is attached to a logger and again to a nested appender.
Implements log4cxx::spi::LoggerRepository.
Refresh the threshold in children of parent.