mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-17 06:36:48 +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['message'] = $record['channel'] . ': ' . $record['message'];
|
||||
|
||||
if (isset($record['context']['context'])) {
|
||||
$record['context'] = $record['context']['context'];
|
||||
}
|
||||
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
|
@@ -54,8 +54,8 @@ class RavenHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function write(array $record)
|
||||
{
|
||||
if ($record['level'] == Logger::ERROR) {
|
||||
$this->ravenClient->captureException($record['context']['context']);
|
||||
if ($record['level'] == Logger::ERROR && isset($record['context']['exception'])) {
|
||||
$this->ravenClient->captureException($record['context']['exception']);
|
||||
} else {
|
||||
$this->ravenClient->captureMessage(
|
||||
$record['formatted']['message'],
|
||||
|
Reference in New Issue
Block a user