summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-29 08:54:53 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-09-29 08:17:23 +0000
commit4fec3d09a08f1116694d2f5e954ba06fb037188d (patch)
treebd326857ecebda00702b651ae6f76b96da4b1137 /lib
parent0d4ea5fc63695361dc07100f3317cf2d8390fb76 (diff)
downloadnextcloud-server-4fec3d09a08f1116694d2f5e954ba06fb037188d.tar.gz
nextcloud-server-4fec3d09a08f1116694d2f5e954ba06fb037188d.zip
Generate exception to log on php errors
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-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]);
}
}