PHP 클래스 yii\log\FileTarget

The log file is specified via [[logFile]]. If the size of the log file exceeds [[maxFileSize]] (in kilo-bytes), a rotation will be performed, which renames the current log file by suffixing the file name with '.1'. All existing log files are moved backwards by one place, i.e., '.2' to '.3', '.1' to '.2', and so on. The property [[maxLogFiles]] specifies how many history files to keep.
부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends Target
파일 보기 프로젝트 열기: yiisoft/yii2 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

공개 메소드들

메소드 설명
export ( ) Writes log messages to a file.
init ( ) Initializes the route.

보호된 메소드들

메소드 설명
rotateFiles ( ) Rotates log files.

메소드 상세

export() 공개 메소드

Writes log messages to a file.
public export ( )

init() 공개 메소드

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

rotateFiles() 보호된 메소드

Rotates log files.
protected rotateFiles ( )

프로퍼티 상세

$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.
public $dirMode

$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.
부터: 2.0.3
public $enableRotation

$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.
public $fileMode

$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.
public $logFile

$maxFileSize 공개적으로 프로퍼티

maximum log file size, in kilo-bytes. Defaults to 10240, meaning 10MB.
public $maxFileSize

$maxLogFiles 공개적으로 프로퍼티

number of log files used for rotation. Defaults to 5.
public $maxLogFiles

$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.
public $rotateByCopy