summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-09-29 10:02:33 +0200
committerGitHub <noreply@github.com>2020-09-29 10:02:33 +0200
commit18411b8da33f3dbffcd6f381aa4c89cf9e8d3ec5 (patch)
tree0ea8378a56e5ab79906e901156a949ec89e0b41f
parentcb08c6cd1866ee7931d2ddafffe3fb2e93b14565 (diff)
parentb0699d41261a271472a092d433d97094e5d754ee (diff)
downloadnextcloud-server-18411b8da33f3dbffcd6f381aa4c89cf9e8d3ec5.tar.gz
nextcloud-server-18411b8da33f3dbffcd6f381aa4c89cf9e8d3ec5.zip
Merge pull request #23083 from nextcloud/bugfix/extend-php-error-logging
Generate exception to log on php errors
-rw-r--r--lib/private/Log/ErrorHandler.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Log/ErrorHandler.php b/lib/private/Log/ErrorHandler.php
index d37af8212a0..e87da0b5d83 100644
--- a/lib/private/Log/ErrorHandler.php
+++ b/lib/private/Log/ErrorHandler.php
@@ -88,12 +88,14 @@ class ErrorHandler {
return;
}
$msg = $message . ' at ' . $file . '#' . $line;
- self::$logger->error(self::removePassword($msg), ['app' => 'PHP']);
+ $e = new \Error(self::removePassword($msg));
+ self::$logger->logException($e, ['app' => 'PHP']);
}
//Recoverable handler which catch all errors, warnings and notices
public static function onAll($number, $message, $file, $line) {
$msg = $message . ' at ' . $file . '#' . $line;
- self::$logger->debug(self::removePassword($msg), ['app' => 'PHP']);
+ $e = new \Error(self::removePassword($msg));
+ self::$logger->logException($e, ['app' => 'PHP', 'level' => 0]);
}
}