PHP 클래스 Scalr\LogCollector\AbstractLogger

저자: Constantine Karnacvevych ([email protected])
파일 보기 프로젝트 열기: scalr/scalr 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$defaultTag string Default tag to send
$enabled boolean Indicates whether logging is enabled
$subscribers array Event subscribers
$writer Scalr\LogCollector\Writers\AbstractWriter A backend writer

공개 메소드들

메소드 설명
__construct ( array $config ) Constructor. Instantiates AbstractLogger, prepares backend
getTimestamp ( integer $time = null ) : string Gets current timestamp in common format.
isEnabled ( ) : boolean Returns whether logger is enabled
log ( string $event, variadic $extra ) : boolean Logs event to a specified backend
setIsEnabled ( boolean $isEnabled = null ) : AbstractLogger Set is enabled logger

보호된 메소드들

메소드 설명
getCommonData ( ) : array Prepares extra data to pass to a backend
initializeSubscribers ( ) Initializes Event subscribers
setWriter ( array $config ) : AbstractLogger Set writer to AbstractLogger

비공개 메소드들

메소드 설명
validateConfig ( array $config ) Validates configuration options

메소드 상세

__construct() 공개 메소드

Constructor. Instantiates AbstractLogger, prepares backend
public __construct ( array $config )
$config array Logger configuration

getCommonData() 보호된 메소드

Prepares extra data to pass to a backend
protected getCommonData ( ) : array
리턴 array Prepared extra data for logging

getTimestamp() 공개 정적인 메소드

Gets current timestamp in common format.
public static getTimestamp ( integer $time = null ) : string
$time integer Unix timestamp
리턴 string Returns current timestamp in the server time zone.

initializeSubscribers() 보호된 메소드

The use of the subscribers is to transform object to array
protected initializeSubscribers ( )

isEnabled() 공개 메소드

Returns whether logger is enabled
public isEnabled ( ) : boolean
리턴 boolean true if logger enabled, else - false

log() 공개 메소드

Logs event to a specified backend
public log ( string $event, variadic $extra ) : boolean
$event string Event tag
$extra variadic optional Extra data to pass.
리턴 boolean Indicates whether operation was successful

setIsEnabled() 공개 메소드

Set is enabled logger
public setIsEnabled ( boolean $isEnabled = null ) : AbstractLogger
$isEnabled boolean Whether logger is enabled
리턴 AbstractLogger

setWriter() 보호된 메소드

Set writer to AbstractLogger
protected setWriter ( array $config ) : AbstractLogger
$config array Accepted keys are: proto, path, port, and timeout
리턴 AbstractLogger

프로퍼티 상세

$defaultTag 보호되어 있는 프로퍼티

Default tag to send
protected string $defaultTag
리턴 string

$enabled 보호되어 있는 프로퍼티

Indicates whether logging is enabled
protected bool $enabled
리턴 boolean

$subscribers 보호되어 있는 프로퍼티

Event subscribers
protected array $subscribers
리턴 array

$writer 보호되어 있는 프로퍼티

A backend writer
protected AbstractWriter,Scalr\LogCollector\Writers $writer
리턴 Scalr\LogCollector\Writers\AbstractWriter