Skip to content

Commit

Permalink
[HttpKernel][LoggerDataCollector] Prevent keys collisions in the sani…
Browse files Browse the repository at this point in the history
…tized logs processing
  • Loading branch information
fancyweb committed Mar 27, 2020
1 parent a29ee7c commit 79fe888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -172,7 +172,7 @@ private function sanitizeLogs($logs)
continue;
}

$message = $log['message'];
$message = '_'.$log['message'];
$exception = $log['context']['exception'];

if ($exception instanceof SilencedErrorContext) {
Expand Down
Expand Up @@ -132,13 +132,15 @@ public function getCollectTestData()
[
['message' => 'foo3', 'context' => ['exception' => new \ErrorException('warning', 0, E_USER_WARNING)], 'priority' => 100, 'priorityName' => 'DEBUG'],
['message' => 'foo3', 'context' => ['exception' => new SilencedErrorContext(E_USER_WARNING, __FILE__, __LINE__)], 'priority' => 100, 'priorityName' => 'DEBUG'],
['message' => '0', 'context' => ['exception' => new SilencedErrorContext(E_USER_WARNING, __FILE__, __LINE__)], 'priority' => 100, 'priorityName' => 'DEBUG'],
],
[
['message' => 'foo3', 'context' => ['exception' => ['warning', E_USER_WARNING]], 'priority' => 100, 'priorityName' => 'DEBUG'],
['message' => 'foo3', 'context' => ['exception' => [E_USER_WARNING]], 'priority' => 100, 'priorityName' => 'DEBUG', 'errorCount' => 1, 'scream' => true],
['message' => '0', 'context' => ['exception' => [E_USER_WARNING]], 'priority' => 100, 'priorityName' => 'DEBUG', 'errorCount' => 1, 'scream' => true],
],
0,
1,
2,
];
}
}

0 comments on commit 79fe888

Please sign in to comment.