Lumen
Lumen is supported via a native package, sentry-laravel.
Sentry supports Lumen 5+.
Install the sentry/sentry-laravel package:
Copied
composer require sentry/sentry-laravelRegister Sentry in bootstrap/app.php:
bootstrap/app.phpCopied
$app->register('Sentry\Laravel\ServiceProvider');
# Sentry must be registered before routes are included
require __DIR__ . '/../app/Http/routes.php';Add Sentry reporting to app/Exceptions/Handler.php:
app/Exceptions/Handler.phpCopied
public function report(Exception $exception)
{
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
}
parent::report($exception);
}Create the Sentry configuration file (config/sentry.php):
config/sentry.phpCopied
<?php
return array(
'dsn' => 'https://examplePublicKey@o0.ingest.sentry.io/0',
// capture release as git sha
// 'release' => trim(exec('git log --pretty="%h" -n1 HEAD')),
);You can edit this page on GitHub.
- Package:
- composer:sentry/sentry-laravel
- Version:
- 2.0.1
- Repository:
- https://github.com/getsentry/sentry-laravel