1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

#673 Fix fatal error while normalizing with __toString method which may throw an exception

This commit is contained in:
Anton Sergeyev
2015-10-25 22:44:00 +06:00
parent 3d779cc34d
commit f19d9ce9a1
2 changed files with 18 additions and 1 deletions

View File

@@ -96,7 +96,7 @@ class NormalizerFormatter implements FormatterInterface
// non-serializable objects that implement __toString stringified
if (method_exists($data, '__toString') && !$data instanceof \JsonSerializable) {
$value = (string) $data;
$value = $data->__toString();
} else {
// the rest is json-serialized in some way
$value = $this->toJson($data, true);