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