## Class TFileLogRoute

Description

TFileLogRoute class.

TFileLogRoute records log messages in files. The log files are stored under LogPath and the file name is specified by LogFile. If the size of the log file is greater than 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 MaxLogFiles specifies how many files to be kept.

- since: 3.0
- version: $Revision: $ $Date: $
- author: Qiang Xue <qiang.xue@gmail.com>

Located in /Util/TLogRouter.php (line 323)

    TComponent
       |
       --TApplicationComponent
          |
          --TLogRoute
             |
             --TFileLogRoute

Method Summary
string getLogFile ()
string getLogPath ()
integer getMaxFileSize ()
integer getMaxLogFiles ()
void processLogs (array $logs)
void rotateFiles ()
void setLogFile (string $value)
void setLogPath (string $value)
void setMaxFileSize (integer $value)
void setMaxLogFiles (integer $value)
Variables

#### Inherited Variables

Inherited from TLogRoute

> TLogRoute::$_levelNames
> TLogRoute::$_levelValues

Methods
getLogFile (line 365)

- return: log file name. Defaults to 'prado.log'.
- access: public

string getLogFile ()
getLogPath (line 345)

- return: directory storing log files. Defaults to application runtime path.
- access: public

string getLogPath ()
getMaxFileSize (line 381)

- return: maximum log file size in kilo-bytes (KB). Defaults to 1024 (1MB).
- access: public

integer getMaxFileSize ()
getMaxLogFiles (line 400)

- return: number of files used for rotation. Defaults to 2.
- access: public

integer getMaxLogFiles ()
processLogs (line 419)

Saves log messages in files.

- access: protected

void processLogs (array $logs)

- array $logs: list of log messages

Redefinition of:

TLogRoute::processLogs()
  Processes log messages and sends them to specific destination.

rotateFiles (line 431)

Rotates log files.

- access: protected

void rotateFiles ()
setLogFile (line 373)

- access: public

void setLogFile (string $value)

- string $value: log file name

setLogPath (line 356)

- access: public
- throws: TConfigurationException if log path is invalid

void setLogPath (string $value)

- string $value: directory (in namespace format) storing log files.

setMaxFileSize (line 390)

- access: public
- throws: TInvalidDataValueException if the value is smaller than 1.

void setMaxFileSize (integer $value)

- integer $value: maximum log file size in kilo-bytes (KB).

setMaxLogFiles (line 408)

- access: public

void setMaxLogFiles (integer $value)

- integer $value: number of files used for rotation.

#### Inherited Methods

Inherited From TLogRoute

> TLogRoute::collectLogs()
> TLogRoute::formatLogMessage()
> TLogRoute::getCategories()
> TLogRoute::getLevelName()
> TLogRoute::getLevels()
> TLogRoute::getLevelValue()
> TLogRoute::init()
> TLogRoute::processLogs()
> TLogRoute::setCategories()
> TLogRoute::setLevels()

Inherited From TApplicationComponent

> TApplicationComponent::getApplication()
> TApplicationComponent::getRequest()
> TApplicationComponent::getResponse()
> TApplicationComponent::getService()
> TApplicationComponent::getSession()
> TApplicationComponent::getUser()
> TApplicationComponent::publishAsset()
> TApplicationComponent::publishFilePath()

Inherited From TComponent

> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::detachEventHandler()
> TComponent::evaluateExpression()
> TComponent::evaluateStatements()
> TComponent::getEventHandlers()
> TComponent::getSubProperty()
> TComponent::hasEvent()
> TComponent::hasEventHandler()
> TComponent::hasProperty()
> TComponent::raiseEvent()
> TComponent::setSubProperty()
> TComponent::__get()
> TComponent::__set()

Documentation generated on Mon, 01 May 2006 23:04:06 -0400 by phpDocumentor 1.3.0RC4