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.

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


	
			
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)
Logger &getLoggerByFactory (string $name, mixed $factory)
boolean isDisabled (mixed $level)
void overrideAsNeeded (mixed $override)
void setDisableOverride (mixed $override)
void setRenderer (string $renderedClass, LoggerRenderer $renderer)
void shutdown ()
void &singleton ()
Variables
boolean $debug = false (line 65)
  • var: activate internal logging
  • see: LoggerLog
object currently $defaultFactory (line 59)
  • var: unused
boolean $emittedNoAppenderWarning = false (line 90)
  • var: currently unused
boolean $emittedNoResourceBundleWarning = false (line 95)
  • var: currently unused
array $ht = array() (line 70)
  • var: hierarchy tree. saves here all loggers
LoggerRendererMap $rendererMap (line 80)
LoggerRoot $root = null (line 75)
LoggerLevel $threshold (line 85)
  • var: main level threshold
Methods
Constructor LoggerHierarchy (line 115)

Create a new logger hierarchy.

Create a new logger hierarchy.

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

Add a HierarchyEventListener event to the repository.

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

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

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 146)

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 151)
void emitNoAppenderWarning (mixed $cat)
exists (line 161)

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 166)
void fireAddAppenderEvent (mixed $logger, mixed $appender)
getCurrentCategories (line 174)
void &getCurrentCategories ()
getCurrentLoggers (line 183)

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 201)

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
getLoggerByFactory (line 212)

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 &getLoggerByFactory (string $name, mixed $factory)
  • string $name: logger name
getRendererMap (line 253)
  • return: Get the renderer map for this hierarchy.
LoggerRendererMap &getRendererMap ()
getRootLogger (line 261)
  • return: Get the root of this hierarchy.
LoggerRoot &getRootLogger ()
getThreshold (line 271)
  • return: Returns the threshold Level.
LoggerLevel getThreshold ()
isDisabled (line 281)

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 289)
  • deprecated: Deprecated with no replacement.
void overrideAsNeeded (mixed $override)
resetConfiguration (line 309)

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 null, sets their additivity flag to true and sets the level of the root logger to LOGGER_LEVEL_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 329)
  • deprecated: Deprecated with no replacement.
void setDisableOverride (mixed $override)
setRenderer (line 340)

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 350)

set a new threshold level

set a new threshold level

void setThreshold (LoggerLevel $l)
shutdown (line 369)

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 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 102)
void &singleton ()

Documentation generated on Wed, 10 Sep 2003 22:44:36 +0200 by phpDocumentor 1.2.2