PHP Class Prado\Util\TLogRoute

TLogRoute is the base class for all log route classes. A log route object retrieves log messages from a logger and sends it somewhere, such as files, emails. The messages being retrieved may be filtered first before being sent to the destination. The filters include log level filter and log category filter. To specify level filter, set {@link setLevels Levels} property, which takes a string of comma-separated desired level names (e.g. 'Error, Debug'). To specify category filter, set {@link setCategories Categories} property, which takes a string of comma-separated desired category names (e.g. 'System.Web, System.IO'). Level filter and category filter are combinational, i.e., only messages satisfying both filter conditions will they be returned.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends Prado\TApplicationComponent
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Protected Properties

Свойство Type Description
$_levelNames lookup table for level names
$_levelValues lookup table for level values

Méthodes publiques

Méthode Description
collectLogs ( TLogger $logger ) Retrieves log messages from logger to log route specific destination.
getCategories ( ) : array
getLevels ( ) : integer
init ( $config ) Initializes the route.
setCategories ( $categories )
setLevels ( $levels )

Méthodes protégées

Méthode Description
formatLogMessage ( $message, $level, $category, $time ) : string Formats a log message given different fields.
getLevelName ( $level ) : string
getLevelValue ( $level ) : integer
processLogs ( $logs ) Processes log messages and sends them to specific destination.

Method Details

collectLogs() public méthode

Retrieves log messages from logger to log route specific destination.
public collectLogs ( TLogger $logger )
$logger TLogger

formatLogMessage() protected méthode

Formats a log message given different fields.
protected formatLogMessage ( $message, $level, $category, $time ) : string
Résultat string formatted message

getCategories() public méthode

public getCategories ( ) : array
Résultat array list of categories to be looked for

getLevelName() protected méthode

protected getLevelName ( $level ) : string
Résultat string level name

getLevelValue() protected méthode

protected getLevelValue ( $level ) : integer
Résultat integer level value

getLevels() public méthode

public getLevels ( ) : integer
Résultat integer log level filter

init() public méthode

Initializes the route.
public init ( $config )

processLogs() abstract protected méthode

Derived child classes must implement this method.
abstract protected processLogs ( $logs )

setCategories() public méthode

public setCategories ( $categories )

setLevels() public méthode

public setLevels ( $levels )

Property Details

$_levelNames protected_oe static_oe property

lookup table for level names
protected static $_levelNames

$_levelValues protected_oe static_oe property

lookup table for level values
protected static $_levelValues