mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
Merge pull request #1309 from alex2005git/master
Check for JsonSerializable in normalizeException
This commit is contained in:
@@ -182,6 +182,10 @@ class NormalizerFormatter implements FormatterInterface
|
|||||||
*/
|
*/
|
||||||
protected function normalizeException(Throwable $e, int $depth = 0)
|
protected function normalizeException(Throwable $e, int $depth = 0)
|
||||||
{
|
{
|
||||||
|
if ($e instanceof \JsonSerializable) {
|
||||||
|
return (array) $e->jsonSerialize();
|
||||||
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'class' => Utils::getClass($e),
|
'class' => Utils::getClass($e),
|
||||||
'message' => $e->getMessage(),
|
'message' => $e->getMessage(),
|
||||||
|
Reference in New Issue
Block a user