AncientMariner Posted March 30, 2021 Share Posted March 30, 2021 I'm not too familiar yet with Invision's codebase but would it be easy to register a class early in the booting of the app for something like reporting 500 errors or other weird exceptions to a service like Bugsnag? Integration is generally easy in other PHP apps but would like to see if it could be done with Invision without altering the main source code. Bugsnag docs › Platforms › PHP › Other Link to comment Share on other sites More sharing options...
AncientMariner Posted March 30, 2021 Author Share Posted March 30, 2021 Got it working in a custom IPS\Dispatcher\Front hook but thinking we may need to create a hook for IPS\Dispatcher\Standard to get API errors. Welcome any advice. 🙂 Link to comment Share on other sites More sharing options...
Daniel F Posted March 31, 2021 Share Posted March 31, 2021 Yea, IPS\Dispatcher\Standard seems like a good spot! If you care about literally anything and if you want to log "everything" , you could even hook into IPS\Dispatcher! I'm doing something similar with rollbar:  //<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } abstract class rollbar_hook_dispatcher_standard extends _HOOK_CLASS_ { public function init() { $this->initRollbar(); parent::init(); } protected function initRollbar() { if ( \IPS\Settings::i()->rollbarapikey ) { require_once \IPS\Application::getRootPath('rollbar') . '/sources/vendor/autoload.php'; $config = array( 'access_token' => \IPS\Settings::i()->rollbarapikey, 'environment' => \IPS\Settings::i()->base_url, 'root' => \IPS\ROOT_PATH ); \Rollbar\Rollbar::init($config); } } }  Ilya Hoilik and AncientMariner 2 Link to comment Share on other sites More sharing options...
Recommended Posts