summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-29 08:54:53 +0200
committerJulius Härtl <jus@bitgrid.net>2020-09-29 08:54:53 +0200
commitb0699d41261a271472a092d433d97094e5d754ee (patch)
tree0d304a75bf94768682ada0d8096d4f35f87be194
parent7d0602792280f88af6867db0131d1bf8984b2c2c (diff)
downloadnextcloud-server-b0699d41261a271472a092d433d97094e5d754ee.tar.gz
nextcloud-server-b0699d41261a271472a092d433d97094e5d754ee.zip
Generate exception to log on php errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-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]);
}
}