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


	
			
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, [LoggerFactory $factory = null])
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 64)
  • var: activate internal logging
  • see: LoggerLog
object currently $defaultFactory (line 58)
  • var: unused
boolean $emittedNoAppenderWarning = false (line 89)
  • var: currently unused
boolean $emittedNoResourceBundleWarning = false (line 94)
  • var: currently unused
array $ht = array() (line 69)
  • var: hierarchy tree. saves here all loggers
LoggerRendererMap $rendererMap (line 79)
LoggerRoot $root = null (line 74)
LoggerLevel $threshold (line 84)
  • var: main level threshold
Methods
Constructor LoggerHierarchy (line 114)

Create a new logger hierarchy.

Create a new logger hierarchy.

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

Add a HierarchyEventListener event to the repository.

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

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

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

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

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 165)
void fireAddAppenderEvent (mixed $logger, mixed $appender)
getCurrentCategories (line 173)
void &getCurrentCategories ()
getCurrentLoggers (line 182)

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, [LoggerFactory $factory = null])
getLoggerByFactory (line 217)

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 259)
  • return: Get the renderer map for this hierarchy.
LoggerRendererMap &getRendererMap ()
getRootLogger (line 267)
  • return: Get the root of this hierarchy.
LoggerRoot &getRootLogger ()
getThreshold (line 277)
  • return: Returns the threshold Level.
LoggerLevel getThreshold ()
isDisabled (line 287)

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

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 335)
  • deprecated: Deprecated with no replacement.
void setDisableOverride (mixed $override)
setRenderer (line 346)

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

set a new threshold level

set a new threshold level

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

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

Documentation generated on Mon, 1 Dec 2003 22:09:54 +0100 by phpDocumentor 1.2.2