Customizing 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. A configurable number of breadcrumbs are attached to each error report to help diagnose what events led to the error.

This documentation is for version 6+ of the BugSnag Unity notifier. If you are using older versions, we recommend upgrading to the latest release using our Upgrade guide. Documentation for the previous release can be found on our legacy pages.

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:

Bugsnag.LeaveBreadcrumb("App loaded")
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:

var metadata = new Dictionary<string, object> {
    { "delivery", "express" },
    { "sale", "spring" }
Bugsnag.LeaveBreadcrumb("Preference updated", metadata, 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.