mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 09:06:10 +02:00
Make gelf formatter extend the normalizer one
This commit is contained in:
@@ -76,12 +76,15 @@ class NormalizerFormatter implements FormatterInterface
|
||||
return '[resource]';
|
||||
}
|
||||
|
||||
return sprintf("[object] (%s: %s)", get_class($data), $this->toJson($data));
|
||||
}
|
||||
|
||||
protected function toJson($data)
|
||||
{
|
||||
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
|
||||
$encoded = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
} else {
|
||||
$encoded = json_encode($data);
|
||||
return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
return sprintf("[object] (%s: %s)", get_class($data), $encoded);
|
||||
return json_encode($data);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user