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.

  • author: Qiang Xue <qiang.xue@gmail.com>
  • version: $Id: TLogRouter.php 2996 2011-06-20 15:24:57Z ctrlaltca@gmail.com $
  • since: 3.0

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

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

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

Rotates log files.

  • access: protected
void rotateFiles ()
setLogFile (line 420)
  • access: public
void setLogFile (string $value)
  • string $value: log file name
setLogPath (line 403)
  • throws: TConfigurationException if log path is invalid
  • access: public
void setLogPath (string $value)
  • string $value: directory (in namespace format) storing log files.
setMaxFileSize (line 437)
  • throws: TInvalidDataValueException if the value is smaller than 1.
  • access: public
void setMaxFileSize (integer $value)
  • integer $value: maximum log file size in kilo-bytes (KB).
setMaxLogFiles (line 455)
  • 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::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()

Documentation generated on Mon, 25 Jun 2012 14:38:40 +0200 by phpDocumentor 1.4.3