protected function normalize()

in src/Elastic/Monolog/Formatter/ElasticCommonSchemaFormatter.php [59:74]


    protected function normalize(mixed $data, int $depth = 0): mixed
    {
        if ($depth > $this->maxNormalizeDepth) {
            return parent::normalize($data, $depth);
        }

        if ($data instanceof Throwable) {
            return EcsError::serialize($data);
        }

        if ($data instanceof EcsError) {
            return $data->jsonSerialize();
        }

        return parent::normalize($data, $depth);
    }