spunQ_CachedLogger Class Reference

Reduces the number of log attempts onto a log target. More...

Inheritance diagram for spunQ_CachedLogger:

spunQ_ILogTarget

List of all members.

Public Member Functions

 __construct (spunQ_ILogTarget $logTarget, spunQ_ICache $cache, $timeFrame=60)
 Constructor.
 logMessage ($path, $priority, $message, $file, $line)
 This function will be called by the logging facility.

Private Attributes

 $logTarget
 Actual log target to log to.
 $cache
 Cache to use for storing data about log entries.
 $timeFrame
 Number of seconds to wait between log attempts.


Detailed Description

Reduces the number of log attempts onto a log target.

Will only log once to the provided log target in a defined time frame. Can be used to send mails only once an hour, for example.

Definition at line 8 of file CachedLogger.class.php.


Constructor & Destructor Documentation

spunQ_CachedLogger::__construct ( spunQ_ILogTarget logTarget,
spunQ_ICache $  cache,
timeFrame = 60 
)

Constructor.

Parameters:
$logTarget Actual log target to log to.
$cache Cache to use for storing data about log entries.
$timeFrame Number of seconds to wait between loggings.

Definition at line 34 of file CachedLogger.class.php.


Member Function Documentation

spunQ_CachedLogger::logMessage ( path,
priority,
message,
file,
line 
)

This function will be called by the logging facility.

A logger rule matched a logging event that was triggered and this log target was provided to the rule.

See also:
spunQ_Logger
Parameters:
$path The source of the log event.
$priority The priority with which the Logger was invoked.
$message The message of the log event.
$file The path to the file where the event actually occured.
$line The line within the file where the log event was triggered
Returns:
spunQ_ILogTarget $this

Implements spunQ_ILogTarget.

Definition at line 44 of file CachedLogger.class.php.


Member Data Documentation

spunQ_CachedLogger::$cache [private]

Cache to use for storing data about log entries.

Type:
spunQ_ICache

Definition at line 20 of file CachedLogger.class.php.

spunQ_CachedLogger::$logTarget [private]

Actual log target to log to.

Type:
spunQ_ILogTarget

Definition at line 14 of file CachedLogger.class.php.

spunQ_CachedLogger::$timeFrame [private]

Number of seconds to wait between log attempts.

Type:
integer

Definition at line 26 of file CachedLogger.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:38 2011 for spunQ3 by  doxygen 1.5.9