Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • CChainedLogFilter
  • CDbLogRoute
  • CEmailLogRoute
  • CFileLogRoute
  • CLogFilter
  • CLogger
  • CLogRoute
  • CLogRouter
  • CProfileLogRoute
  • CSysLogRoute
  • CWebLogRoute

Interfaces

  • ILogFilter
  • Overview
  • Package
  • Class
  • Tree

Class CLogRoute

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

CComponent
Extended by CLogRoute

Direct known subclasses

CDbLogRoute, CEmailLogRoute, CFileLogRoute, CSysLogRoute, CWebLogRoute

Indirect known subclasses

CProfileLogRoute
Abstract
Package: system\logging
Copyright: 2008-2013 Yii Software LLC
License: http://www.yiiframework.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 1.0
Located at x2engine/framework/logging/CLogRoute.php
Methods summary
public
# init( )

Initializes the route. This method is invoked after the route is created by the route manager.

Initializes the route. This method is invoked after the route is created by the route manager.

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 message content
$level
integer
$level message level
$category
string
$category message category
$time
integer
$time timestamp

Returns

string
formatted message
public
# collectLogs( CLogger $logger, boolean $processLogs = false )

Retrieves filtered log messages from logger for further processing.

Retrieves filtered log messages from logger for further processing.

Parameters

$logger
CLogger
$logger logger instance
$processLogs
boolean
$processLogs whether to process the logs after they are collected from the logger
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
$logs list of messages. Each array element represents one message with the following structure: array( [0] => message (string) [1] => level (string) [2] => category (string) [3] => timestamp (float, obtained by microtime(true));
Methods inherited from CComponent
__call(), __get(), __isset(), __set(), __unset(), asa(), attachBehavior(), attachBehaviors(), attachEventHandler(), canGetProperty(), canSetProperty(), detachBehavior(), detachBehaviors(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), getEventHandlers(), hasEvent(), hasEventHandler(), hasProperty(), raiseEvent()
Properties summary
public boolean $enabled true
#

whether to enable this log route. Defaults to true.

whether to enable this log route. Defaults to true.

public string $levels ''
#

list of levels separated by comma or space. Defaults to empty, meaning all levels.

list of levels separated by comma or space. Defaults to empty, meaning all levels.

public mixed $categories array()
#

array of categories, or string list separated by comma or space. Defaults to empty array, meaning all categories.

array of categories, or string list separated by comma or space. Defaults to empty array, meaning all categories.

public mixed $except array()
#

array of categories, or string list separated by comma or space, to EXCLUDE from logs. Defaults to empty array, meaning no categories are excluded. This will exclude any categories after $categories has been ran.

array of categories, or string list separated by comma or space, to EXCLUDE from logs. Defaults to empty array, meaning no categories are excluded. This will exclude any categories after $categories has been ran.

public mixed $filter
#

the additional filter (eg CLogFilter) that can be applied to the log messages. The value of this property will be passed to YiiBase::createComponent() to create a log filter object. As a result, this can be either a string representing the filter class name or an array representing the filter configuration. In general, the log filter class should implement ILogFilter interface. If you want to apply multiple filters you can use CChainedLogFilter to do so. Defaults to null, meaning no filter will be used.

the additional filter (eg CLogFilter) that can be applied to the log messages. The value of this property will be passed to YiiBase::createComponent() to create a log filter object. As a result, this can be either a string representing the filter class name or an array representing the filter configuration. In general, the log filter class should implement ILogFilter interface. If you want to apply multiple filters you can use CChainedLogFilter to do so. Defaults to null, meaning no filter will be used.

public array $logs array()
#

the logs that are collected so far by this log route.

the logs that are collected so far by this log route.

Since

1.1.0
API documentation generated by ApiGen 2.8.0