## 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: $Id: TLogRouter.php 2415 2008-03-24 20:39:47Z xue $
- author: Qiang Xue <qiang.xue@gmail.com>

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

    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 367)

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

string getLogFile ()
getLogPath (line 347)

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

string getLogPath ()
getMaxFileSize (line 383)

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

integer getMaxFileSize ()
getMaxLogFiles (line 402)

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

integer getMaxLogFiles ()
processLogs (line 421)

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 433)

Rotates log files.

- access: protected

void rotateFiles ()
setLogFile (line 375)

- access: public

void setLogFile (string $value)

- string $value: log file name

setLogPath (line 358)

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

void setLogPath (string $value)

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

setMaxFileSize (line 392)

- 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 410)

- 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::addParsedObject()
> TComponent::attachEventHandler()
> TComponent::canGetProperty()
> TComponent::canSetProperty()
> TComponent::createdOnTemplate()
> 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, 21 Apr 2008 11:35:33 -0400 by phpDocumentor 1.3.0RC4