PHP Class ExceptionLogRoute

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: 1.0
Author: Qiang Xue ([email protected])
Inheritance: extends CLogRoute
Datei anzeigen Open project: openeyes/openeyes

Public Properties

Property Type Description
$adminEmail
$emailSubject
$exclude_regex
$useragent_regex

Public Methods

Method Description
getLogFile ( ) : string
getLogPath ( ) : string
getMaxFileSize ( ) : integer
getMaxLogFiles ( ) : integer
init ( ) Initializes the route.
isFiltered ( $msg )
setLogFile ( string $value )
setLogPath ( string $value )
setMaxFileSize ( integer $value )
setMaxLogFiles ( integer $value )
userAgentFiltered ( $useragent )

Protected Methods

Method Description
processLogs ( array $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 'application.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 5.

init() public method

This method is invoked after the route is created by the route manager.
public init ( )

isFiltered() public method

public isFiltered ( $msg )

processLogs() protected method

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

rotateFiles() protected method

Rotates log files.
protected rotateFiles ( )

setLogFile() public method

public setLogFile ( string $value )
$value string log file name

setLogPath() public method

public setLogPath ( string $value )
$value string directory for storing log files.

setMaxFileSize() public method

public setMaxFileSize ( integer $value )
$value integer maximum log file size in kilo-bytes (KB).

setMaxLogFiles() public method

public setMaxLogFiles ( integer $value )
$value integer number of files used for rotation.

userAgentFiltered() public method

public userAgentFiltered ( $useragent )

Property Details

$adminEmail public_oe property

public $adminEmail

$emailSubject public_oe property

public $emailSubject

$exclude_regex public_oe property

public $exclude_regex

$useragent_regex public_oe property

public $useragent_regex