Custom diagnostics

In order to quickly reproduce and fix errors, it is often helpful to send
additional application-specific diagnostic data to Bugsnag. This can be
accomplished by registering a function to be executed before an error report is
sent:

Leaving breadcrumbs

In order to understand what happened in your application before each error, it
can be helpful to leave short log statements that we call breadcrumbs. The
last 25 breadcrumbs are attached to an error report to help diagnose what
events lead to the error. Captured breadcrumbs are shown on your Bugsnag
dashboard as a part of the error report.

Session tracking

Bugsnag can track the number of “sessions” that happen in your application. This enables Bugsnag to provide and compare crash rates between releases to help you understand the quality of your releases. This functionality is disabled by default, but can be enabled through the configuration:

Bugsnag::setAutoCaptureSessions(true);

Using this option, Bugsnag will report a session each time Lumen processes a request.

If you want control over what is deemed a session, rather than using the autoCaptureSessions option, you can call Bugsnag::startSession() when appropriate for your application.

Tracking releases

By sending your source revision or application version to us when you release a
new version of your app, you’ll be able to see in which release each error was
introduced. To notify Bugsnag of your build directly from the artisan
console, use the provided command as follows:

Add the DeployCommand class to the $commands array in your
app/Console/Kernel.php file: