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
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

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

Méthodes protégées

Méthode Description
processLogs ( $logs ) Saves log messages in files.
rotateFiles ( ) Rotates log files.

Method Details

getLogFile() public méthode

public getLogFile ( ) : string
Résultat string log file name. Defaults to 'prado.log'.

getLogPath() public méthode

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

getMaxFileSize() public méthode

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

getMaxLogFiles() public méthode

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

processLogs() protected méthode

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

rotateFiles() protected méthode

Rotates log files.
protected rotateFiles ( )

setLogFile() public méthode

public setLogFile ( $value )

setLogPath() public méthode

public setLogPath ( $value )

setMaxFileSize() public méthode

public setMaxFileSize ( $value )

setMaxLogFiles() public méthode

public setMaxLogFiles ( $value )