Customizing breadcrumbs

In order to understand what happened in your application before each crash, it can be helpful to leave short log statements that we call breadcrumbs. A configurable number of breadcrumbs are attached to each error report to help diagnose what events led to the error.

Our Flutter package is currently in the pre-release stage and is not yet intended for production use.

Automatic breadcrumbs

By default, Bugsnag captures breadcrumbs for common actions and device changes, including:

  • Low memory warnings
  • Device rotation
  • Menu presentation
  • Screenshot capture (not the screenshot itself)
  • Undo and redo
  • Table view selection
  • Window visibility changes
  • Non-fatal errors
  • Log messages

This can be controlled using the Enabled Breadcrumb Types configuration option.

Adding manual breadcrumbs

Append manual breadcrumbs with a message via the Bugsnag client:

await bugsnag.leaveBreadcrumb('App loaded');
await bugsnag.leaveBreadcrumb('User clicked a button');

Bugsnag will keep track of the time and order of the breadcrumbs, and show them on your dashboard.

Attaching metadata

Additional data can be attached to breadcrumbs by providing the additional metadata argument. Metadata will be presented on the Bugsnag dashboard alongside the breadcrumb name and type:

await bugsnag.leaveBreadcrumb(
  'Preference updated',
  metadata: const {
    'from': 'moka',
    'to': 'french press'
  },
  type: BreadcrumbType.state,
);

Breadcrumb “types” can be used to differentiate different types of events, such as user activity and changes in application state. See the Enabled Breadcrumb Types configuration option for a description of the types available. This type will affect how your breadcrumb is shown on the dashboard but they will not be affected by the Enabled Breadcrumb Types configuration option.