PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TLogRoute

TLogRoute class.

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 setLevels Levels property, which takes a string of comma-separated desired level names (e.g. 'Error, Debug'). To specify category filter, set 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.

TComponent
Extended by TApplicationComponent
Extended by TLogRoute

Direct known subclasses

TBrowserLogRoute, TDbLogRoute, TEmailLogRoute, TFileLogRoute, TFirePhpLogRoute

Indirect known subclasses

TFirebugLogRoute
Abstract
Package: System\Util
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Util/TLogRouter.php
Methods summary
public
# init( TXmlElement $config )

Initializes the route.

Initializes the route.

Parameters

$config
TXmlElement
configurations specified in TLogRouter.
public integer
# getLevels( )

Returns

integer
log level filter
public
# setLevels( integer|string $levels )

Parameters

$levels
integer|string
integer log level filter (in bits). If the value is a string, it is assumed to be comma-separated level names. Valid level names include 'Debug', 'Info', 'Notice', 'Warning', 'Error', 'Alert' and 'Fatal'.
public array
# getCategories( )

Returns

array
list of categories to be looked for
public
# setCategories( array|string $categories )

Parameters

$categories
array|string
list of categories to be looked for. If the value is a string, it is assumed to be comma-separated category names.
protected string
# getLevelName( integer $level )

Parameters

$level
integer
level value

Returns

string
level name
protected integer
# getLevelValue( string $level )

Parameters

$level
string
level name

Returns

integer
level value
protected string
# formatLogMessage( string $message, integer $level, string $category, integer $time )

Formats a log message given different fields.

Formats a log message given different fields.

Parameters

$message
string
message content
$level
integer
message level
$category
string
message category
$time
integer
timestamp

Returns

string
formatted message
public
# collectLogs( TLogger $logger )

Retrieves log messages from logger to log route specific destination.

Retrieves log messages from logger to log route specific destination.

Parameters

$logger
TLogger
logger instance
abstract protected
# processLogs( array $logs )

Processes log messages and sends them to specific destination. Derived child classes must implement this method.

Processes log messages and sends them to specific destination. Derived child classes must implement this method.

Parameters

$logs
array
list of messages. Each array elements represents one message with the following structure: array( [0] => message [1] => level [2] => category [3] => timestamp);
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __construct(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Properties summary
protected static array $_levelNames array( TLogger::DEBUG=>'Debug', TLogger::INFO=>'Info', TLogger::NOTICE=>'Notice', TLogger::WARNING=>'Warning', TLogger::ERROR=>'Error', TLogger::ALERT=>'Alert', TLogger::FATAL=>'Fatal' )
#

lookup table for level names

lookup table for level names

protected static array $_levelValues array( 'debug'=>TLogger::DEBUG, 'info'=>TLogger::INFO, 'notice'=>TLogger::NOTICE, 'warning'=>TLogger::WARNING, 'error'=>TLogger::ERROR, 'alert'=>TLogger::ALERT, 'fatal'=>TLogger::FATAL )
#

lookup table for level values

lookup table for level values

Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO