aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Log.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Log.php')
-rw-r--r--lib/private/Log.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php
index 4ab647bc6c1..e4be5134f11 100644
--- a/lib/private/Log.php
+++ b/lib/private/Log.php
@@ -312,6 +312,11 @@ class Log implements ILogger, IDataLogger {
$app = $context['app'] ?? 'no app in context';
$level = $context['level'] ?? ILogger::ERROR;
+ $minLevel = $this->getLogLevel($context);
+ if ($level < $minLevel && ($this->crashReporters === null || !$this->crashReporters->hasReporters())) {
+ return;
+ }
+
// if an error is raised before the autoloader is properly setup, we can't serialize exceptions
try {
$serializer = $this->getSerializer();
@@ -325,7 +330,6 @@ class Log implements ILogger, IDataLogger {
$data = array_merge($serializer->serializeException($exception), $data);
$data = $this->interpolateMessage($data, $context['message'] ?? '--', 'CustomMessage');
- $minLevel = $this->getLogLevel($context);
array_walk($context, [$this->normalizer, 'format']);