MongoDBFormatter
in package
implements
FormatterInterface
Formats a record for use with the MongoDBHandler.
Tags
Table of Contents
Interfaces
- FormatterInterface
- Interface for formatters
Properties
- $exceptionTraceAsString : mixed
- $maxNestingLevel : mixed
Methods
- __construct() : mixed
- format() : mixed
- Formats a log record.
- formatBatch() : mixed
- Formats a set of log records.
- formatArray() : mixed
- formatDate() : mixed
- formatException() : mixed
- formatObject() : mixed
Properties
$exceptionTraceAsString
private
mixed
$exceptionTraceAsString
$maxNestingLevel
private
mixed
$maxNestingLevel
Methods
__construct()
public
__construct([int $maxNestingLevel = 3 ][, bool $exceptionTraceAsString = true ]) : mixed
Parameters
- $maxNestingLevel : int = 3
-
0 means infinite nesting, the $record itself is level 1, $record['context'] is 2
- $exceptionTraceAsString : bool = true
-
set to false to log exception traces as a sub documents instead of strings
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
formatArray()
protected
formatArray(array<string|int, mixed> $record[, mixed $nestingLevel = 0 ]) : mixed
Parameters
- $record : array<string|int, mixed>
- $nestingLevel : mixed = 0
formatDate()
protected
formatDate(DateTime $value, mixed $nestingLevel) : mixed
Parameters
- $value : DateTime
- $nestingLevel : mixed
formatException()
protected
formatException(Exception $exception, mixed $nestingLevel) : mixed
Parameters
- $exception : Exception
- $nestingLevel : mixed
formatObject()
protected
formatObject(mixed $value, mixed $nestingLevel) : mixed
Parameters
- $value : mixed
- $nestingLevel : mixed