Catch and send Magento exceptions to Sentry instance using the PHP Raven library, whilst still preserving normal Magento exception handling.
-
Download and extract the module
wget -O master.zip --no-check-certificate https://github.com/sonassi/magestack-sentry/archive/master.zip unzip master.zip rsync -vPa magestack-sentry*/app/ app/ rsync -vPa magestack-sentry*/lib/ lib/ rm -rf magestack-sentry* master.zip
-
Log into your Magento admin and configure the DSN in
Admin > System > Config > MageStack > Sentry
-
Copy
app/code/core/Mage/Core/Exception.php
toapp/code/local/Mage/Core/Exception.php
cp app/code/core/Mage/Core/Exception.php app/code/local/Mage/Core/Exception.php
-
Append the following to the end of the new
Exception.php
class,/** * Additions by Sonassi to log exceptions with Sentry. * */ public function __construct($message = '', $code = 0, $previous = null) { parent::__construct($message, $code, $previous); Mage::getSingleton('magestack.sentry/client')->captureException($this); }