mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 21:56:31 +02:00
Fix issue in handling of broken iterators when serializing stack frames, fixes #772
This commit is contained in:
@@ -186,6 +186,9 @@ class JsonFormatter extends NormalizerFormatter
|
|||||||
foreach ($trace as $frame) {
|
foreach ($trace as $frame) {
|
||||||
if (isset($frame['file'])) {
|
if (isset($frame['file'])) {
|
||||||
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
||||||
|
} elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
|
||||||
|
// We should again normalize the frames, because it might contain invalid items
|
||||||
|
$data['trace'][] = $frame['function'];
|
||||||
} else {
|
} else {
|
||||||
// We should again normalize the frames, because it might contain invalid items
|
// We should again normalize the frames, because it might contain invalid items
|
||||||
$data['trace'][] = $this->normalize($frame);
|
$data['trace'][] = $this->normalize($frame);
|
||||||
|
@@ -131,6 +131,9 @@ class NormalizerFormatter implements FormatterInterface
|
|||||||
foreach ($trace as $frame) {
|
foreach ($trace as $frame) {
|
||||||
if (isset($frame['file'])) {
|
if (isset($frame['file'])) {
|
||||||
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
$data['trace'][] = $frame['file'].':'.$frame['line'];
|
||||||
|
} elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
|
||||||
|
// We should again normalize the frames, because it might contain invalid items
|
||||||
|
$data['trace'][] = $frame['function'];
|
||||||
} else {
|
} else {
|
||||||
// We should again normalize the frames, because it might contain invalid items
|
// We should again normalize the frames, because it might contain invalid items
|
||||||
$data['trace'][] = $this->toJson($this->normalize($frame), true);
|
$data['trace'][] = $this->toJson($this->normalize($frame), true);
|
||||||
|
Reference in New Issue
Block a user