Serializes a log message to GELF

  • see
  • author Matt Lehner
public Monolog\Formatter\NormalizerFormatter::SIMPLE_DATE = 'Y-m-d\TH:i:sP'
public __construct(?string $systemName = NULL, ?string $extraPrefix = NULL, string $contextPrefix = 'ctxt_', ?int $maxLength = NULL)
public Monolog\Formatter\NormalizerFormatter::addJsonEncodeOption( $option)
public format(array $record) : Gelf\Message


public Monolog\Formatter\NormalizerFormatter::formatBatch(array $records)


public Monolog\Formatter\NormalizerFormatter::getMaxNormalizeDepth() : int

The maximum number of normalization levels to go through

public Monolog\Formatter\NormalizerFormatter::getMaxNormalizeItemCount() : int

The maximum number of items to normalize per level

public Monolog\Formatter\NormalizerFormatter::removeJsonEncodeOption( $option)
public Monolog\Formatter\NormalizerFormatter::setJsonPrettyPrint(bool $enable) : self

Enables json_encode pretty print.

public Monolog\Formatter\NormalizerFormatter::setMaxNormalizeDepth(int $maxNormalizeDepth) : self
public Monolog\Formatter\NormalizerFormatter::setMaxNormalizeItemCount(int $maxNormalizeItemCount) : self
protected Monolog\Formatter\GelfMessageFormatter::DEFAULT_MAX_LENGTH = 32766
protected $contextPrefix
  • var string a prefix for 'context' fields from the Monolog record (optional)
protected Monolog\Formatter\NormalizerFormatter::$dateFormat
protected $extraPrefix
  • var string a prefix for 'extra' fields from the Monolog record (optional)
protected $maxLength
  • var int max length per field
protected Monolog\Formatter\NormalizerFormatter::$maxNormalizeDepth
protected Monolog\Formatter\NormalizerFormatter::$maxNormalizeItemCount
protected $systemName
  • var string the name of the system for the Gelf log message
protected Monolog\Formatter\NormalizerFormatter::formatDate(DateTimeInterface $date)
protected Monolog\Formatter\NormalizerFormatter::normalize( $data, int $depth = 0)
  • return int|bool|string|null|array
protected Monolog\Formatter\NormalizerFormatter::normalizeException(Throwable $e, int $depth = 0)
  • return array
protected Monolog\Formatter\NormalizerFormatter::toJson( $data, bool $ignoreErrors = false) : string

Return the JSON representation of a value

  • throws RuntimeException if encoding fails and errors are not ignored
  • return string if encoding fails and ignoreErrors is true 'null' is returned
private $logLevels

Translates Monolog log levels to Graylog2 log priorities.

© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only