PHP code example of nbeyond / raygun-exception-listener
1. Go to this page and download the library: Download nbeyond/raygun-exception-listener library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nbeyond / raygun-exception-listener example snippets
namespace App\EventListener;
use RaygunFilterParams\Config;
use RaygunFilterParams\DataFilter;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
class ExceptionListener
{
public function onKernelException(ExceptionEvent $event)
{
$config = new Config($_ENV['RAYGUN_BASE_URI'], $_ENV['RAYGUN_API_KEY']);
$config->setUserTracking(true);
$dataFilter = new DataFilter($config);
$dataFilter->sendToRaygun($event->getThrowable());
}
}
$config->setUserTracking(true);
$config->setProxy('proxy:8080');