PHP 클래스 yii\elasticsearch\ElasticsearchTarget

부터: 2.0.5
저자: Eugene Terentev ([email protected])
상속: extends yii\log\Target
파일 보기 프로젝트 열기: yiisoft/yii2-elasticsearch

공개 프로퍼티들

프로퍼티 타입 설명
$cacheContext If true, context message will cached once it's been created. Makes sense to use with [[includeContext]].
$db the elasticsearch connection object or the application component ID of the elasticsearch connection.
$includeContext If true, context will be included in every message. This is convenient if you log application errors and analyze them with tools like Kibana.
$index Elasticsearch index name.
$logContext If true, context will be logged as a separate message after all other messages.
$options array URL options.
$type Elasticsearch type name.

보호된 프로퍼티들

프로퍼티 타입 설명
$_contextMessage Context message cache (can be used multiple times if context is appended to every message)

공개 메소드들

메소드 설명
collect ( array $messages, boolean $final ) Processes the given log messages.
export ( )
init ( ) This method will initialize the [[elasticsearch]] property to make sure it refers to a valid Elasticsearch connection.
prepareMessage ( array $message ) : string Prepares a log message.

보호된 메소드들

메소드 설명
getContextMessage ( ) : array If [[includeContext]] property is false, returns context message normally.

메소드 상세

collect() 공개 메소드

This method will filter the given messages with [[levels]] and [[categories]]. And if requested, it will also export the filtering result to specific medium (e.g. email). Depending on the [[includeContext]] attribute, a context message will be either created or ignored.
public collect ( array $messages, boolean $final )
$messages array log messages to be processed. See [[Logger::messages]] for the structure of each message.
$final boolean whether this method is called at the end of the current application

export() 공개 메소드

public export ( )

getContextMessage() 보호된 메소드

If [[includeContext]] is true, returns an empty string (so that context message in [[collect]] is not generated), expecting that context will be appended to every message in [[prepareMessage]].
protected getContextMessage ( ) : array
리턴 array the context information

init() 공개 메소드

This method will initialize the [[elasticsearch]] property to make sure it refers to a valid Elasticsearch connection.
public init ( )

prepareMessage() 공개 메소드

Prepares a log message.
public prepareMessage ( array $message ) : string
$message array The log message to be formatted.
리턴 string

프로퍼티 상세

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

Context message cache (can be used multiple times if context is appended to every message)
protected $_contextMessage

$cacheContext 공개적으로 프로퍼티

If true, context message will cached once it's been created. Makes sense to use with [[includeContext]].
public $cacheContext

$db 공개적으로 프로퍼티

the elasticsearch connection object or the application component ID of the elasticsearch connection.
public $db

$includeContext 공개적으로 프로퍼티

If true, context will be included in every message. This is convenient if you log application errors and analyze them with tools like Kibana.
public $includeContext

$index 공개적으로 프로퍼티

Elasticsearch index name.
public $index

$logContext 공개적으로 프로퍼티

If true, context will be logged as a separate message after all other messages.
public $logContext

$options 공개적으로 프로퍼티

URL options.
public array $options
리턴 array

$type 공개적으로 프로퍼티

Elasticsearch type name.
public $type