summaryrefslogtreecommitdiffstats
path: root/lib/private/Log.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-05-09 14:06:44 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-05-09 14:06:44 +0200
commitd3a244f9d9f3a90b7bd92a22210601c7f543441f (patch)
tree414cd462f3aa50801f0e7be515e73add464237d5 /lib/private/Log.php
parent35b31110efce6799b1926c9485a246a1c60782dd (diff)
downloadnextcloud-server-d3a244f9d9f3a90b7bd92a22210601c7f543441f.tar.gz
nextcloud-server-d3a244f9d9f3a90b7bd92a22210601c7f543441f.zip
Allow crash reporters to catpture any message
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Log.php')
-rw-r--r--lib/private/Log.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php
index 43ff4cc9dee..4af833d778f 100644
--- a/lib/private/Log.php
+++ b/lib/private/Log.php
@@ -35,6 +35,7 @@ declare(strict_types=1);
namespace OC;
+use function array_merge;
use InterfaSys\LogNormalizer\Normalizer;
use OC\Log\ExceptionSerializer;
@@ -42,7 +43,6 @@ use OCP\Log\IFileBased;
use OCP\Log\IWriter;
use OCP\ILogger;
use OCP\Support\CrashReport\IRegistry;
-use OCP\Util;
/**
* logging utilities
@@ -216,11 +216,22 @@ class Log implements ILogger {
if ($level >= $minLevel) {
$this->writeLog($app, $message, $level);
- }
- if (!is_null($this->crashReporters)) {
- $this->crashReporters->delegateBreadcrumb($message, 'log', $context);
+ if ($this->crashReporters !== null) {
+ $messageContext = array_merge(
+ $context,
+ [
+ 'level' => $level
+ ]
+ );
+ $this->crashReporters->delegateMessage($message, $messageContext);
+ }
+ } else {
+ if ($this->crashReporters !== null) {
+ $this->crashReporters->delegateBreadcrumb($message, 'log', $context);
+ }
}
+
}
private function getLogLevel($context) {