Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/FrontController.php')
-rw-r--r--core/FrontController.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/FrontController.php b/core/FrontController.php
index 8a32c425b0..320239f45b 100644
--- a/core/FrontController.php
+++ b/core/FrontController.php
@@ -21,6 +21,7 @@ use Piwik\Http\ControllerResolver;
use Piwik\Http\Router;
use Piwik\Plugins\CoreAdminHome\CustomLogo;
use Piwik\Session\SessionAuth;
+use Psr\Log\LoggerInterface;
/**
* This singleton dispatches requests to the appropriate plugin Controller.
@@ -107,6 +108,11 @@ class FrontController extends Singleton
*/
private static function generateSafeModeOutputFromException($e)
{
+ StaticContainer::get(LoggerInterface::class)->error('Uncaught exception: {exception}', [
+ 'exception' => $e,
+ 'ignoreInScreenWriter' => true,
+ ]);
+
$error = array(
'message' => $e->getMessage(),
'file' => $e->getFile(),
@@ -256,6 +262,11 @@ class FrontController extends Singleton
$lastError['backtrace'] = ' on ' . $lastError['file'] . '(' . $lastError['line'] . ")\n"
. ErrorHandler::getFatalErrorPartialBacktrace();
+ StaticContainer::get(LoggerInterface::class)->error('Fatal error encountered: {exception}', [
+ 'exception' => $lastError,
+ 'ignoreInScreenWriter' => true,
+ ]);
+
$message = self::generateSafeModeOutputFromError($lastError);
echo $message;
}