1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-23 01:26:11 +02:00
This commit is contained in:
Jordi Boggiano
2016-09-25 17:46:38 +02:00
parent 941c21b793
commit 96f4fd718f
15 changed files with 39 additions and 36 deletions

View File

@@ -40,7 +40,7 @@ class RollbarHandler extends AbstractProcessingHandler
*/
protected $rollbarNotifier;
protected $levelMap = array(
protected $levelMap = [
Logger::DEBUG => 'debug',
Logger::INFO => 'info',
Logger::NOTICE => 'info',
@@ -49,7 +49,7 @@ class RollbarHandler extends AbstractProcessingHandler
Logger::CRITICAL => 'critical',
Logger::ALERT => 'critical',
Logger::EMERGENCY => 'critical',
);
];
/**
* Records whether any log records have been added since the last flush of the rollbar notifier
@@ -76,17 +76,17 @@ class RollbarHandler extends AbstractProcessingHandler
protected function write(array $record)
{
$context = $record['context'];
$payload = array();
$payload = [];
if (isset($context['payload'])) {
$payload = $context['payload'];
unset($context['payload']);
}
$context = array_merge($context, $record['extra'], array(
$context = array_merge($context, $record['extra'], [
'level' => $this->levelMap[$record['level']],
'monolog_level' => $record['level_name'],
'channel' => $record['channel'],
'datetime' => $record['datetime']->format('U'),
));
]);
if (isset($context['exception']) && $context['exception'] instanceof Exception) {
$exception = $context['exception'];