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 CFileLogRoute

CFileLogRoute records log messages in files.

The log files are stored under setLogPath logPath and the file name is specified by setLogFile logFile. If the size of the log file is greater than setMaxFileSize maxFileSize (in kilo-bytes), a rotation is performed, which renames the current log file by suffixing the file name with '.1'. All existing log files are moved backwards one place, i.e., '.2' to '.3', '.1' to '.2'. The property setMaxLogFiles maxLogFiles specifies how many files to be kept. If the property CFileLogRoute::$rotateByCopy is true, the primary log file will be rotated by a copy and truncated (to be more compatible with log tailers) otherwise it will be rotated by being renamed.

CComponent
Extended by CLogRoute
Extended by CFileLogRoute
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/CFileLogRoute.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()
public string
# getLogPath( )

Returns

string
directory storing log files. Defaults to application runtime path.
public
# setLogPath( string $value )

Parameters

$value
string
$value directory for storing log files.

Throws

CException
if the path is invalid
public string
# getLogFile( )

Returns

string
log file name. Defaults to 'application.log'.
public
# setLogFile( string $value )

Parameters

$value
string
$value log file name
public integer
# getMaxFileSize( )

Returns

integer
maximum log file size in kilo-bytes (KB). Defaults to 1024 (1MB).
public
# setMaxFileSize( integer $value )

Parameters

$value
integer
$value maximum log file size in kilo-bytes (KB).
public integer
# getMaxLogFiles( )

Returns

integer
number of files used for rotation. Defaults to 5.
public
# setMaxLogFiles( integer $value )

Parameters

$value
integer
$value number of files used for rotation.
protected
# processLogs( array $logs )

Saves log messages in files.

Saves log messages in files.

Parameters

$logs
array
$logs list of log messages
protected
# rotateFiles( )

Rotates log files.

Rotates log files.

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 boolean $rotateByCopy false
#

Whether to rotate primary log by copy and truncate which is more compatible with log tailers. Defaults to false.

Whether to rotate primary log by copy and truncate which is more compatible with log tailers. Defaults to false.

Since

1.1.14
Properties inherited from CLogRoute
$categories, $enabled, $except, $filter, $levels, $logs
Magic properties summary
public string $logPath
#

Directory storing log files. Defaults to application runtime path.

Directory storing log files. Defaults to application runtime path.

public string $logFile
#

Log file name. Defaults to 'application.log'.

Log file name. Defaults to 'application.log'.

public integer $maxFileSize
#

Maximum log file size in kilo-bytes (KB). Defaults to 1024 (1MB).

Maximum log file size in kilo-bytes (KB). Defaults to 1024 (1MB).

public integer $maxLogFiles
#

Number of files used for rotation. Defaults to 5.

Number of files used for rotation. Defaults to 5.

API documentation generated by ApiGen 2.8.0