Browse Source

Generate exception to log on php errors

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/841/head^2
Julius Härtl 1 month ago
parent
commit
b0699d4126
No known key found for this signature in database GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      lib/private/Log/ErrorHandler.php

+ 4
- 2
lib/private/Log/ErrorHandler.php View File

@@ -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]);
}
}

Loading…
Cancel
Save