mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-06 13:16:39 +02:00
Tidy up handler
This commit is contained in:
@@ -60,10 +60,8 @@ class RavenHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function write(array $record)
|
||||
{
|
||||
$level = $this->logLevels[$record['level']];
|
||||
|
||||
$options = array();
|
||||
$options['level'] = $level;
|
||||
$options['level'] = $this->logLevels[$record['level']];
|
||||
if (!empty($record['context'])) {
|
||||
$options['extra']['context'] = $record['context'];
|
||||
}
|
||||
@@ -71,17 +69,13 @@ class RavenHandler extends AbstractProcessingHandler
|
||||
$options['extra']['extra'] = $record['extra'];
|
||||
}
|
||||
|
||||
if ($record['level'] >= Logger::ERROR && isset($record['context']['exception'])) {
|
||||
$this->ravenClient->captureException($record['context']['exception']);
|
||||
if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
|
||||
$options['extra']['message'] = $record['formatted'];
|
||||
$this->ravenClient->captureException($record['context']['exception'], $options);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->ravenClient->captureMessage(
|
||||
$record['formatted'],
|
||||
array(), // $params - not used
|
||||
version_compare(Raven_Client::VERSION, '0.1.0', '>') ? $options : $level, // $level or $options
|
||||
false // $stack
|
||||
);
|
||||
$this->ravenClient->captureMessage($record['formatted'], array(), $options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user