Menu

## NormalizerFormatter
in package
implements FormatterInterface

NormalizerFormatter.php : 22

Normalizes incoming records to remove objects/resources so it's easier to dump to various targets

##### Tags

author

  Jordi Boggiano j.boggiano@seld.be

### Interfaces, Classes and Traits

FormatterInterface
  Interface for formatters

### Table of Contents

SIMPLE_DATE = "Y-m-d H:i:s"
$dateFormat : mixed
__construct() : mixed
format() : mixed
  Formats a log record.
formatBatch() : mixed
  Formats a set of log records.
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`

### Methods

#### __construct()

NormalizerFormatter.php : 31
`public __construct([string $dateFormat = null ]) : mixed`

##### Parameters

$dateFormat : string = null

  The format of the timestamp: one supported by DateTime::format

##### Return values

mixed —

#### format()

NormalizerFormatter.php : 42

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

#### 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