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 2658 2009-05-23 06:12:08Z godzilla80@gmx.net $
  • author: Qiang Xue <qiang.xue@gmail.com>

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

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 381)
  • return: log file name. Defaults to 'prado.log'.
  • access: public
string getLogFile ()
getLogPath (line 361)
  • return: directory storing log files. Defaults to application runtime path.
  • access: public
string getLogPath ()
getMaxFileSize (line 397)
  • return: maximum log file size in kilo-bytes (KB). Defaults to 1024 (1MB).
  • access: public
integer getMaxFileSize ()
getMaxLogFiles (line 416)
  • return: number of files used for rotation. Defaults to 2.
  • access: public
integer getMaxLogFiles ()
processLogs (line 435)

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

Rotates log files.

  • access: protected
void rotateFiles ()
setLogFile (line 389)
  • access: public
void setLogFile (string $value)
  • string $value: log file name
setLogPath (line 372)
  • access: public
  • throws: TConfigurationException if log path is invalid
void setLogPath (string $value)
  • string $value: directory (in namespace format) storing log files.
setMaxFileSize (line 406)
  • 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 424)
  • 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 Sun, 24 May 2009 16:47:58 -0400 by phpDocumentor 1.3.0RC4