Steps:
Step 1: Install the laravel/lumen-framework packaged on your lumen
Step 2: Add in the Sentry Service provider to your bootstrap/app.php
$app->register(Sentry\SentryLaravel\SentryLumenServiceProvider::class);
Step 3: Create a file in your config/sentry.php and this code below
<?php
return array(
'dsn' => env('SENTRY_DSN'),
// capture release as git sha
// 'release' => trim(exec('git log --pretty="%h" -n1 HEAD')),
// Capture bindings on SQL queries
'breadcrumbs.sql_bindings' => true,
// Capture default user context
'user_context' => true,
);
Step 4: Add
SENTRY_DSN=SENTRY_URL
environment variable to your .env file
Step 5: Add in the sentry to your app/Exceptions/Handler.php file. Will look like this:
public function report(Exception $e)
{
if (app()->bound('sentry') && $this->shouldReport($e)) {
app('sentry')->captureException($e);
}
parent::report($e);
}