PHP Class Prado\Util\TFileLogRoute

TFileLogRoute records log messages in files. The log files are stored under {@link setLogPath LogPath} and the file name is specified by {@link setLogFile LogFile}. If the size of the log file is greater than {@link setMaxFileSize 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 {@link setMaxLogFiles MaxLogFiles} specifies how many files to be kept.
Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TLogRoute
Datei anzeigen Open project: pradosoft/prado

Public Methods

Method Description
getLogFile ( ) : string
getLogPath ( ) : string
getMaxFileSize ( ) : integer
getMaxLogFiles ( ) : integer
setLogFile ( $value )
setLogPath ( $value )
setMaxFileSize ( $value )
setMaxLogFiles ( $value )

Protected Methods

Method Description
processLogs ( $logs ) Saves log messages in files.
rotateFiles ( ) Rotates log files.

Method Details

getLogFile() public method

public getLogFile ( ) : string
return string log file name. Defaults to 'prado.log'.

getLogPath() public method

public getLogPath ( ) : string
return string directory storing log files. Defaults to application runtime path.

getMaxFileSize() public method

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

getMaxLogFiles() public method

public getMaxLogFiles ( ) : integer
return integer number of files used for rotation. Defaults to 2.

processLogs() protected method

Saves log messages in files.
protected processLogs ( $logs )

rotateFiles() protected method

Rotates log files.
protected rotateFiles ( )

setLogFile() public method

public setLogFile ( $value )

setLogPath() public method

public setLogPath ( $value )

setMaxFileSize() public method

public setMaxFileSize ( $value )

setMaxLogFiles() public method

public setMaxLogFiles ( $value )