Downloads
Stars
Version
PHP Elastic APM for Laravel This package is compatible with laravel >= 5.2
composer require faridcs/laravel-apm
Add this line to provider and aliases array in config/app.php
'providers' => [
/*
* Laravel Framework Service Providers...
*/
// ... more provider
faridcs\ApmLaravel\Providers\ElasticApmServiceProvider::class,
],
'aliases' => [
// more aliases
'ElasticApm' => faridcs\ApmLaravel\Facades\ElasticApm::class,
],
php artisan vendor:publish --provider="alopeyk\ApmLaravel\Providers\ElasticApmServiceProvider" --tag="config"
Register the middleware in app/Http/Kernel.php
protected $middleware = [
// ... more middleware
\faridcs\ApmLaravel\Middleware\RecordTransaction::class,
];
In app/Exceptions/Handler
, add the following to the report
method:
ElasticApm::captureThrowable($exception);
ElasticApm::send();
Make sure to import the facade at the top of your file:
use ElasticApm;