Formats a record for use with the MongoDBHandler.

CloneableInstantiable
ImplementsMonolog\Formatter\FormatterInterface
Methods
public __construct(int $maxNestingLevel = 3, bool $exceptionTraceAsString = true)
 


    public format(array $record) : array
     
    {@inheritDoc}

    public formatBatch(array $records) : array
     
    {@inheritDoc}

    Methods
    protected formatArray(array $record, int $nestingLevel = 0)
     


    • return array|string Array except when max nesting level is reached then a string "[...]"
    protected formatDate(DateTimeInterface $value, int $nestingLevel) : MongoDB\BSON\UTCDateTime
    protected formatException(Throwable $exception, int $nestingLevel)
    protected formatObject( $value, int $nestingLevel)
    Properties
    private $exceptionTraceAsString
    private $isLegacyMongoExt
    private $maxNestingLevel
    Methods
    private getMongoDbDateTime(DateTimeInterface $value) : MongoDB\BSON\UTCDateTime
    private legacyGetMongoDbDateTime(DateTimeInterface $value) : MongoDB\BSON\UTCDateTime
     
    This is needed to support MongoDB Driver v1.19 and below

    See https://github.com/mongodb/mongo-php-driver/issues/426

    It can probably be removed in 2.1 or later once MongoDB's 1.2 is released and widely adopted

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