1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-24 18:16:10 +02:00

Store native BSON types as-is in the MongoDB formatter (#1620)

This commit is contained in:
Gemma Lynn
2022-03-13 21:04:53 +01:00
committed by GitHub
parent 56899afff9
commit b39a394c05
2 changed files with 32 additions and 1 deletions

View File

@@ -11,6 +11,7 @@
namespace Monolog\Formatter;
use MongoDB\BSON\Type;
use MongoDB\BSON\UTCDateTime;
use Monolog\Utils;
@@ -85,7 +86,7 @@ class MongoDBFormatter implements FormatterInterface
$array[$name] = $this->formatException($value, $nestingLevel + 1);
} elseif (is_array($value)) {
$array[$name] = $this->formatArray($value, $nestingLevel + 1);
} elseif (is_object($value)) {
} elseif (is_object($value) && !$value instanceof Type) {
$array[$name] = $this->formatObject($value, $nestingLevel + 1);
}
}