Class LoggerHierarchy

Description

This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy.

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.

  • todo: Implements a LoggerFactory to create Loggers
  • version: $Revision: 1.15 $
  • author: VxR <mailto:vxr@vxr.it>

Located in Program_Root/log4php/LoggerHierarchy.php (line 57)


	
			
Variable Summary
Method Summary
LoggerHierarchy LoggerHierarchy (object $root)
void addHierarchyEventListener (mixed $listener)
void addRenderer (mixed $classToRender, mixed $or)
void clear ()
void emitNoAppenderWarning (mixed $cat)
boolean exists (string $name)
void fireAddAppenderEvent (mixed $logger, mixed $appender)
Logger &getLogger (string $name)
integer getThreshold ()
boolean isDisabled (mixed $level)
void overrideAsNeeded (mixed $override)
void setDisableOverride (mixed $override)
void setRenderer (string $renderedClass, LoggerRenderer $renderer)
void setThreshold (integer $l)
void shutdown ()
void &singleton ()
Variables
boolean $debug = false (line 68)
  • var: activate internal logging
  • see: LoggerLog
object currently $defaultFactory (line 62)
  • var: unused
boolean $emittedNoAppenderWarning = false (line 94)
  • var: currently unused
boolean $emittedNoResourceBundleWarning = false (line 99)
  • var: currently unused
array $ht = array() (line 73)
  • var: hierarchy tree. saves here all loggers
LoggerRendererMap $rendererMap (line 83)
LoggerRoot $root = null (line 78)
integer $threshold = LOGGER_LEVEL_ALL (line 89)
Methods
Constructor LoggerHierarchy (line 119)

Create a new logger hierarchy.

Create a new logger hierarchy.

LoggerHierarchy LoggerHierarchy (object $root)
  • object $root: the root logger
addHierarchyEventListener (line 132)

Add a HierarchyEventListener event to the repository.

Add a HierarchyEventListener event to the repository. Not Yet Impl.

void addHierarchyEventListener (mixed $listener)
addRenderer (line 141)

Add an object renderer for a specific class.

Add an object renderer for a specific class. Not Yet Impl.

void addRenderer (mixed $classToRender, mixed $or)
clear (line 149)

This call will clear all logger definitions from the internal hashtable.

This call will clear all logger definitions from the internal hashtable.

void clear ()
emitNoAppenderWarning (line 154)
void emitNoAppenderWarning (mixed $cat)
exists (line 164)

Check if the named logger exists in the hierarchy.

Check if the named logger exists in the hierarchy.

boolean exists (string $name)
  • string $name
fireAddAppenderEvent (line 169)
void fireAddAppenderEvent (mixed $logger, mixed $appender)
getCurrentCategories (line 177)
void &getCurrentCategories ()
getCurrentLoggers (line 186)

Returns all the currently defined categories in this hierarchy as an array.

Returns all the currently defined categories in this hierarchy as an array.

array &getCurrentLoggers ()
getLogger (line 204)

Return a new logger instance named as the first parameter using the default factory.

Return a new logger instance named as the first parameter using the default factory.

Logger &getLogger (string $name)
  • string $name: logger name
getRendererMap (line 245)
  • return: Get the renderer map for this hierarchy.
LoggerRendererMap &getRendererMap ()
getRootLogger (line 253)
  • return: Get the root of this hierarchy.
LoggerRoot &getRootLogger ()
getThreshold (line 263)
  • return: Returns the threshold Level.
integer getThreshold ()
isDisabled (line 273)

This method will return true if this repository is disabled for level object passed as parameter and false otherwise.

This method will return true if this repository is disabled for level object passed as parameter and false otherwise.

boolean isDisabled (mixed $level)
overrideAsNeeded (line 281)
  • deprecated: Deprecated with no replacement.
void overrideAsNeeded (mixed $override)
resetConfiguration (line 301)

Reset all values contained in this hierarchy instance to their default.

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


1 null
, sets their additivity flag to

1 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.

void resetConfiguration ()
setDisableOverride (line 321)
  • deprecated: Deprecated with no replacement.
void setDisableOverride (mixed $override)
setRenderer (line 332)

Used by subclasses to add a renderer to the hierarchy passed as parameter.

Used by subclasses to add a renderer to the hierarchy passed as parameter.

void setRenderer (string $renderedClass, LoggerRenderer $renderer)
  • string $renderedClass: a LoggerRenderer class name
  • LoggerRenderer $renderer
setThreshold (line 342)

set a new threshold level

set a new threshold level

void setThreshold (integer $l)
  • integer $l
shutdown (line 361)

Shutting down a hierarchy will safely close and remove all appenders in all categories including the root logger.

Shutting down a hierarchy will safely close and remove all appenders in all categories including the root logger. Some appenders such as LoggerSocketAppender need to be closed before the application exists. Otherwise, pending logging events might be lost.

The


1 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.

void shutdown ()
singleton (line 106)
void &singleton ()

Documentation generated on Wed, 3 Sep 2003 01:02:31 +0200 by phpDocumentor 1.2.2