Documentation

ElasticsearchFormatter extends NormalizerFormatter
in package

Format a log message into an Elasticsearch record

Tags
author

Avtandil Kikabidze akalongman@gmail.com

Table of Contents

SIMPLE_DATE  = "Y-m-d H:i:s"
$dateFormat  : mixed
$index  : string
$type  : string
__construct()  : mixed
format()  : mixed
Formats a log record.
formatBatch()  : mixed
Formats a set of log records.
getIndex()  : string
Getter index
getType()  : string
Getter type
getDocument()  : array<string|int, mixed>
Convert a log message into an Elasticsearch record
normalize()  : mixed
normalizeException()  : mixed
toJson()  : string
Return the JSON representation of a value

Constants

Properties

Methods

__construct()

public __construct(string $index, string $type) : mixed
Parameters
$index : string

Elasticsearch index name

$type : string

Elasticsearch record type

Return values
mixed

format()

Formats a log record.

public format(array<string|int, mixed> $record) : mixed
Parameters
$record : array<string|int, mixed>

A record to format

Return values
mixed

The formatted record

formatBatch()

Formats a set of log records.

public formatBatch(array<string|int, mixed> $records) : mixed
Parameters
$records : array<string|int, mixed>

A set of records to format

Return values
mixed

The formatted set of records

getDocument()

Convert a log message into an Elasticsearch record

protected getDocument(array<string|int, mixed> $record) : array<string|int, mixed>
Parameters
$record : array<string|int, mixed>

Log message

Return values
array<string|int, mixed>

normalize()

protected normalize(mixed $data, mixed $depth) : mixed
Parameters
$data : mixed
$depth : mixed
Return values
mixed

normalizeException()

protected normalizeException(mixed $e) : mixed
Parameters
$e : mixed
Return values
mixed

toJson()

Return the JSON representation of a value

protected toJson(mixed $data[, bool $ignoreErrors = false ]) : string
Parameters
$data : mixed
$ignoreErrors : bool = false
Tags
throws
RuntimeException

if encoding fails and errors are not ignored

Return values
string

Search results