for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nord\Lumen\NewRelic;
use Exception;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* Class NewRelicExceptionHandler
* @package Nord\Lumen\NewRelic
*/
class NewRelicExceptionHandler implements ExceptionHandler
{
* @var array list of class names of exceptions that should not be reported to New Relic. Defaults to the
* NotFoundHttpException class used for 404 requests.
protected $ignoredExceptions = [
NotFoundHttpException::class,
];
* NewRelicExceptionHandler constructor.
*
* @param array $ignoredExceptions (optional)
public function __construct(array $ignoredExceptions = [])
if (!empty($ignoredExceptions)) {
$this->ignoredExceptions = $ignoredExceptions;
}
* @inheritdoc
public function report(Exception $e)
if (extension_loaded('newrelic') && in_array(get_class($e), $this->ignoredExceptions)) {
newrelic_notice_error($e->getMessage(), $e);
public function render($request, Exception $e)
public function renderForConsole($output, Exception $e)