mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 17:16:18 +02:00
Rework how exceptions are stored and accessed using suggestions from
@Seldaek in https://github.com/Seldaek/monolog/pull/76/files#r737312
This commit is contained in:
@@ -43,10 +43,6 @@ class RavenFormatter extends NormalizerFormatter
|
|||||||
$record['level'] = $this->logLevels[$record['level']];
|
$record['level'] = $this->logLevels[$record['level']];
|
||||||
$record['message'] = $record['channel'] . ': ' . $record['message'];
|
$record['message'] = $record['channel'] . ': ' . $record['message'];
|
||||||
|
|
||||||
if (isset($record['context']['context'])) {
|
|
||||||
$record['context'] = $record['context']['context'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -54,8 +54,8 @@ class RavenHandler extends AbstractProcessingHandler
|
|||||||
*/
|
*/
|
||||||
protected function write(array $record)
|
protected function write(array $record)
|
||||||
{
|
{
|
||||||
if ($record['level'] == Logger::ERROR) {
|
if ($record['level'] == Logger::ERROR && isset($record['context']['exception'])) {
|
||||||
$this->ravenClient->captureException($record['context']['context']);
|
$this->ravenClient->captureException($record['context']['exception']);
|
||||||
} else {
|
} else {
|
||||||
$this->ravenClient->captureMessage(
|
$this->ravenClient->captureMessage(
|
||||||
$record['formatted']['message'],
|
$record['formatted']['message'],
|
||||||
|
Reference in New Issue
Block a user