diff --git a/lib/private/Log.php b/lib/private/Log.php index a41c728df0..bed0321bef 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -351,6 +351,7 @@ class Log implements ILogger { $msg = isset($context['message']) ? $context['message'] : 'Exception'; $msg .= ': ' . json_encode($data); $this->log($level, $msg, $context); + $context['level'] = $level; if (!is_null($this->crashReporters)) { $this->crashReporters->delegateReport($exception, $context); } diff --git a/tests/lib/LoggerTest.php b/tests/lib/LoggerTest.php index 54336da105..6f528bd6fa 100644 --- a/tests/lib/LoggerTest.php +++ b/tests/lib/LoggerTest.php @@ -90,7 +90,7 @@ class LoggerTest extends TestCase { $e = new \Exception('test'); $this->registry->expects($this->once()) ->method('delegateReport') - ->with($e, []); + ->with($e, ['level' => 3]); $this->logger->logException($e); @@ -109,7 +109,7 @@ class LoggerTest extends TestCase { $e = new \Exception('test'); $this->registry->expects($this->once()) ->method('delegateReport') - ->with($e, []); + ->with($e, ['level' => 3]); $this->logger->logException($e); @@ -128,7 +128,7 @@ class LoggerTest extends TestCase { $e = new \Exception('test'); $this->registry->expects($this->once()) ->method('delegateReport') - ->with($e, []); + ->with($e, ['level' => 3]); $this->logger->logException($e); @@ -147,7 +147,7 @@ class LoggerTest extends TestCase { $e = new \Exception('test'); $this->registry->expects($this->once()) ->method('delegateReport') - ->with($e, []); + ->with($e, ['level' => 3]); $this->logger->logException($e);