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 /plugins/UserCountry | |
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 'plugins/UserCountry')
-rw-r--r-- | plugins/UserCountry/GeoIPAutoUpdater.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/UserCountry/GeoIPAutoUpdater.php b/plugins/UserCountry/GeoIPAutoUpdater.php index db47feb063..9d2ab6af92 100644 --- a/plugins/UserCountry/GeoIPAutoUpdater.php +++ b/plugins/UserCountry/GeoIPAutoUpdater.php @@ -28,6 +28,7 @@ use Piwik\Scheduler\Schedule\Monthly; use Piwik\Scheduler\Schedule\Weekly; use Piwik\SettingsPiwik; use Piwik\Unzip; +use Psr\Log\LoggerInterface; /** * Used to automatically update installed GeoIP databases, and manages the updater's @@ -113,7 +114,10 @@ class GeoIPAutoUpdater extends Task } } catch (Exception $ex) { // message will already be prefixed w/ 'GeoIPAutoUpdater: ' - Log::error($ex); + StaticContainer::get(LoggerInterface::class)->error('Auto-update failed: {exception}', [ + 'exception' => $ex, + 'ignoreInScreenWriter' => true, + ]); $this->performRedundantDbChecks(); throw $ex; } @@ -572,9 +576,16 @@ class GeoIPAutoUpdater extends Task if (self::$unzipPhpError !== null) { list($errno, $errstr, $errfile, $errline) = self::$unzipPhpError; - if($logErrors) { - Log::error("GeoIPAutoUpdater: Encountered PHP error when performing redundant tests on GeoIP " - . "%s database: %s: %s on line %s of %s.", $type, $errno, $errstr, $errline, $errfile); + if ($logErrors) { + StaticContainer::get(LoggerInterface::class)->error("GeoIPAutoUpdater: Encountered PHP error when performing redundant tests on GeoIP " + . "{type} database: {errno}: {errstr} on line {errline} of {errfile}.", [ + 'ignoreInScreenWriter' => true, + 'type' => $type, + 'errno' => $errno, + 'errstr' => $errstr, + 'errline' => $errline, + 'errfile' => $errfile, + ]); } // get the current filename for the DB and an available new one to rename it to |