PHP Класс yii\elasticsearch\ElasticsearchTarget

С версии: 2.0.5
Автор: Eugene Terentev ([email protected])
Наследование: extends yii\log\Target
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$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.

Защищенные свойства (Protected)

Свойство Тип Описание
$_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