1
0
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:
Marc Abramowitz
2012-04-26 11:39:21 -07:00
parent f6e75e44cb
commit 3238a7417b
2 changed files with 2 additions and 6 deletions

View File

@@ -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;
}
}

View File

@@ -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'],