Public Member Functions | |
Hierarchy (const LoggerPtr &root) | |
void | addHierarchyEventListener (const spi::HierarchyEventListenerPtr &listener) |
void | clear () |
LoggerPtr | exists (const String &name) |
void | setThreshold (const String &levelStr) |
void | setThreshold (const LevelPtr &l) |
const LevelPtr & | getThreshold () const |
LoggerPtr | getLogger (const String &name) |
LoggerPtr | getLogger (const String &name, spi::LoggerFactoryPtr factory) |
LoggerList | getCurrentLoggers () const |
LoggerPtr | getRootLogger () const |
bool | isDisabled (int level) const |
void | resetConfiguration () |
void | shutdown () |
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.
|
Create a new logger hierarchy.
|
|
Add a HierarchyEventListener event to the repository. Implements LoggerRepository. |
|
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. |
|
Check if the named logger exists in the hierarchy. If so return its reference, otherwise returns
Implements LoggerRepository. |
|
Returns all the currently defined loggers in this hierarchy as a LoggerList. The root logger is not included in the returned LoggerList. Implements LoggerRepository. |
|
Return a new logger instance named as the first parameter using
If a logger of that name already exists, then it will be returned. Otherwise, a new logger will be instantiated by the
Implements LoggerRepository. |
|
Return a new logger instance named as the first parameter using the default factory. 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 LoggerRepository. |
|
Get the root of this hierarchy. Implements LoggerRepository. |
|
Returns a Level representation of the Implements LoggerRepository. |
|
This method will return Implements LoggerRepository. |
|
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 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 LoggerRepository. |
|
Enable logging for logging requests with level
Implements LoggerRepository. |
|
The string form of setThreshold. Implements LoggerRepository. |
|
Shutting down a hierarchy will safely close and remove all appenders in all categories including the root logger. Some appenders such as SocketAppender and AsyncAppender need to be closed before the application exists. Otherwise, pending logging events might be lost.
The Implements LoggerRepository. |