diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2019-02-18 17:02:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-18 17:02:29 +0300 |
commit | 8d3fe62389469347f7ebc551ee36f4527655b804 (patch) | |
tree | beea4c5ba26e3969e47441f948c152b471bf20a9 /core/Plugin/Visualization.php | |
parent | 99d42f5b8ca81f5481635c0cbea794d4b7de783b (diff) |
Enable fingers crossed handler via INI config and show backtrace in logs/archive api output (#13923)
* Add config to use FringersCrossedHandler (untested)
* Get to work in different contexts.
* Add changelog note.
* Make sure more exceptions make it to the logs, make backtrace include previous exceptions, do not use screen writer if in cli mode, always print backtrace if in CLI mode and archivephp triggered.
* Add log capturing handler.
* Remove options from global.ini.php sibnce they may be temporary.
* Add UI test triggering an error w/ the screen handler.
* Add some more log statements, ignore logs in screen writer, replace part of message in ExceptionToTextProcessor instead of whole message.
* Add missing license.
* Update changelog, move new item to 3.9
* Fixing some integration tests.
* Fix another unit test.
* One more test fix.
* Try to get rid of xss testing warning.
* Try again to get rid of warning.
* Try again to get rid of warning.
* Try again to get rid of warning.
Diffstat (limited to 'core/Plugin/Visualization.php')
-rw-r--r-- | core/Plugin/Visualization.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/Plugin/Visualization.php b/core/Plugin/Visualization.php index 71c9eca248..f23a183ed6 100644 --- a/core/Plugin/Visualization.php +++ b/core/Plugin/Visualization.php @@ -28,6 +28,7 @@ use Piwik\View; use Piwik\ViewDataTable\Manager as ViewDataTableManager; use Piwik\Plugin\Manager as PluginManager; use Piwik\API\Request as ApiRequest; +use Psr\Log\LoggerInterface; /** * The base class for report visualizations that output HTML and use JavaScript. @@ -193,16 +194,16 @@ class Visualization extends ViewDataTable } catch (NoAccessException $e) { throw $e; } catch (\Exception $e) { - $logMessage = "Failed to get data from API: " . $e->getMessage(); - $message = $e->getMessage(); + StaticContainer::get(LoggerInterface::class)->error('Failed to get data from API: {exception}', [ + 'exception' => $e, + 'ignoreInScreenWriter' => true, + ]); + $message = $e->getMessage(); if (\Piwik_ShouldPrintBackTraceWithMessage()) { - $logMessage .= "\n" . $e->getTraceAsString(); $message .= "\n" . $e->getTraceAsString(); } - Log::error($logMessage); - $loadingError = array('message' => $message); } |