Packages:
default
System
System.Caching
System.Collections
System.Data
System.Data.ActiveRecord
System.Data.ActiveRecord.Relations
System.Data.ActiveRecord.Scaffold
System.Data.ActiveReecord.Scaffold.InputBuilder
System.Data.Commom.Sqlite
System.Data.Common
System.Data.Common.Mssql
System.Data.Common.Mysql
System.Data.Common.Oracle
System.Data.Common.Pgsql
System.Data.Common.Sqlite
System.Data.DataGateway
System.Data.SqlMap
System.Data.SqlMap.Configuration
System.Data.SqlMap.Statements
System.Exceptions
System.I18N
System.IO
System.Security
System.Util
System.Web
System.Web.Services
System.Web.UI
System.Web.UI.ActiveControls
System.Web.UI.WebControls
System.Web.UI.WebControls.assets
System.Xml


Classes:
Keyword

Class TFileLogRoute

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

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
Author: Qiang Xue <qiang.xue@gmail.com>

Method Summary
string
string
integer
integer
protected  void
processLogs ( array $logs)
Saves log messages in files.
protected  void
Rotates log files.
void
setLogFile ( string $value)
void
setLogPath ( string $value)
void
setMaxFileSize ( integer $value)
void
setMaxLogFiles ( integer $value)
Methods Inherited From TLogRoute
TLogRoute::collectLogs(), TLogRoute::formatLogMessage(), TLogRoute::getCategories(), TLogRoute::getLevelName(), TLogRoute::getLevels(), TLogRoute::getLevelValue(), TLogRoute::init(), TLogRoute::setCategories(), TLogRoute::setLevels()
Methods Inherited From TApplicationComponent
TApplicationComponent::getApplication(), TApplicationComponent::getRequest(), TApplicationComponent::getResponse(), TApplicationComponent::getService(), TApplicationComponent::getSession(), TApplicationComponent::getUser(), TApplicationComponent::publishAsset(), TApplicationComponent::publishFilePath()
Methods 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()

Method Details

getLogFile

public string getLogFile ()

Output
string log file name. Defaults to 'prado.log'.
Exception

getLogPath

public string getLogPath ()

Output
string directory storing log files. Defaults to application runtime path.
Exception

getMaxFileSize

public integer getMaxFileSize ()

Output
integer maximum log file size in kilo-bytes (KB). Defaults to 1024 (1MB).
Exception

getMaxLogFiles

public integer getMaxLogFiles ()

Output
integer number of files used for rotation. Defaults to 2.
Exception

processLogs

protected void processLogs (array $logs )

Saves log messages in files.

Input
array$logslist of log messages
Output
Exception

rotateFiles

protected void rotateFiles ()

Rotates log files.

Output
Exception

setLogFile

public void setLogFile (string $value )

Input
string$valuelog file name
Output
Exception

setLogPath

public void setLogPath (string $value )

Input
string$valuedirectory (in namespace format) storing log files.
Output
Exception
throwsTConfigurationException if log path is invalid

setMaxFileSize

public void setMaxFileSize (integer $value )

Input
integer$valuemaximum log file size in kilo-bytes (KB).
Output
Exception
throwsTInvalidDataValueException if the value is smaller than 1.

setMaxLogFiles

public void setMaxLogFiles (integer $value )

Input
integer$valuenumber of files used for rotation.
Output
Exception