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 CDbLogRoute

CDbLogRoute stores log messages in a database table.

To specify the database table for storing log messages, set CDbLogRoute::$logTableName as the name of the table and specify CDbLogRoute::$connectionID to be the ID of a CDbConnection application component. If they are not set, a SQLite3 database named 'log-YiiVersion.db' will be created and used under the application runtime directory.

CComponent
Extended by CLogRoute
Extended by CDbLogRoute
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/CDbLogRoute.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.

Overrides

CLogRoute::init()
protected
# createLogTable( CDbConnection $db, string $tableName )

Creates the DB table for storing log messages.

Creates the DB table for storing log messages.

Parameters

$db
CDbConnection
$db the database connection
$tableName
string
$tableName the name of the table to be created
protected CDbConnection
# getDbConnection( )

Returns

CDbConnection
the DB connection instance

Throws

CException
if CDbLogRoute::$connectionID does not point to a valid application component.
protected
# processLogs( array $logs )

Stores log messages into database.

Stores log messages into database.

Parameters

$logs
array
$logs list of log messages
Methods inherited from CLogRoute
collectLogs(), formatLogMessage()
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 string $connectionID
#

the ID of CDbConnection application component. If not set, a SQLite database will be automatically created and used. The SQLite database file is <span class="php-keyword1">protected</span>/runtime/<span class="php-keyword2">log</span>-YiiVersion.db.

the ID of CDbConnection application component. If not set, a SQLite database will be automatically created and used. The SQLite database file is <span class="php-keyword1">protected</span>/runtime/<span class="php-keyword2">log</span>-YiiVersion.db.

public string $logTableName 'YiiLog'
#

the name of the DB table that stores log content. Defaults to 'YiiLog'. If CDbLogRoute::$autoCreateLogTable is false and you want to create the DB table manually by yourself, you need to make sure the DB table is of the following structure:

 (
        id       INTEGER NOT NULL PRIMARY KEY,
        level    VARCHAR(128),
        category VARCHAR(128),
        logtime  INTEGER,
        message  TEXT
  )

Note, the 'id' column must be created as an auto-incremental column. In MySQL, this means it should be id INTEGER NOT <span class="php-keyword1">NULL</span> AUTO_INCREMENT PRIMARY <span class="php-keyword2">KEY</span>; In PostgreSQL, it is id SERIAL PRIMARY <span class="php-keyword2">KEY</span>.

the name of the DB table that stores log content. Defaults to 'YiiLog'. If CDbLogRoute::$autoCreateLogTable is false and you want to create the DB table manually by yourself, you need to make sure the DB table is of the following structure:

 (
        id       INTEGER NOT NULL PRIMARY KEY,
        level    VARCHAR(128),
        category VARCHAR(128),
        logtime  INTEGER,
        message  TEXT
  )

Note, the 'id' column must be created as an auto-incremental column. In MySQL, this means it should be id INTEGER NOT <span class="php-keyword1">NULL</span> AUTO_INCREMENT PRIMARY <span class="php-keyword2">KEY</span>; In PostgreSQL, it is id SERIAL PRIMARY <span class="php-keyword2">KEY</span>.

See

CDbLogRoute::$autoCreateLogTable
public boolean $autoCreateLogTable true
#

whether the log DB table should be automatically created if not exists. Defaults to true.

whether the log DB table should be automatically created if not exists. Defaults to true.

See

CDbLogRoute::$logTableName
Properties inherited from CLogRoute
$categories, $enabled, $except, $filter, $levels, $logs
API documentation generated by ApiGen 2.8.0