Menu

## ElasticaFormatter extends NormalizerFormatter
in package

ElasticaFormatter.php : 21

Format a log message into an Elastica Document

##### Tags

author

  Jelle Vink jelle.vink@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() : Document
  Convert a log message into an Elastica Document
normalize() : mixed
normalizeException() : mixed
toJson() : string
  Return the JSON representation of a value

### Constants

#### SIMPLE_DATE

NormalizerFormatter.php : 24
`public mixed SIMPLE_DATE = "Y-m-d H:i:s"`

### Properties

#### $dateFormat

NormalizerFormatter.php : 26
`protected mixed $dateFormat`

#### $index

ElasticaFormatter.php : 26
`protected string $index`

Elastic search index name

#### $type

ElasticaFormatter.php : 31
`protected string $type`

Elastic search document type

### Methods

#### __construct()

ElasticaFormatter.php : 37
`public __construct(string $index, string $type) : mixed`

##### Parameters

$index : string

  Elastic Search index name

$type : string

  Elastic Search document type

##### Return values

mixed —

#### format()

ElasticaFormatter.php : 49

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()

NormalizerFormatter.php : 50

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

#### getIndex()

ElasticaFormatter.php : 60

Getter index

`public getIndex() : string`

##### Return values

string —

#### getType()

ElasticaFormatter.php : 69

Getter type

`public getType() : string`

##### Return values

string —

#### getDocument()

ElasticaFormatter.php : 80

Convert a log message into an Elastica Document

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

##### Parameters

$record : array<string|int, mixed>

  Log message

##### Return values

Document —

#### normalize()

NormalizerFormatter.php : 59
`protected normalize(mixed $data, mixed $depth) : mixed`

##### Parameters

$data : mixed
$depth : mixed

##### Return values

mixed —

#### normalizeException()

NormalizerFormatter.php : 122
`protected normalizeException(mixed $e) : mixed`

##### Parameters

$e : mixed

##### Return values

mixed —

#### toJson()

NormalizerFormatter.php : 176

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