Property | Type | Description | |
---|---|---|---|
$dirMode | the permission to be set for newly created directories. This value will be used by PHP chmod() function. No umask will be applied. Defaults to 0775, meaning the directory is read-writable by owner and group, but read-only for other users. | ||
$enableRotation | whether log files should be rotated when they reach a certain [[maxFileSize|maximum size]]. Log rotation is enabled by default. This property allows you to disable it, when you have configured an external tools for log rotation on your server. | ||
$fileMode | the permission to be set for newly created log files. This value will be used by PHP chmod() function. No umask will be applied. If not set, the permission will be determined by the current environment. | ||
$logFile | log file path or path alias. If not set, it will use the "@runtime/logs/app.log" file. The directory containing the log files will be automatically created if not existing. | ||
$maxFileSize | maximum log file size, in kilo-bytes. Defaults to 10240, meaning 10MB. | ||
$maxLogFiles | number of log files used for rotation. Defaults to 5. | ||
$rotateByCopy | Whether to rotate log files by copy and truncate in contrast to rotation by renaming files. Defaults to true to be more compatible with log tailers and is windows systems which do not play well with rename on open files. Rotation by renaming however is a bit faster. The problem with windows systems where the rename() function does not work with files that are opened by some process is described in a comment by Martin Pelletier in the PHP documentation. By setting rotateByCopy to true you can work around this problem. |
Method | Description | |
---|---|---|
export ( ) | Writes log messages to a file. | |
init ( ) | Initializes the route. |
Method | Description | |
---|---|---|
rotateFiles ( ) | Rotates log files. |
public init ( ) |
public $dirMode |
public $enableRotation |
public $fileMode |
public $logFile |
public $maxFileSize |
public $maxLogFiles |
public $rotateByCopy |