BugSnag automatically captures a variety of data to help you debug your errors. You may wish to avoid capturing some types of data, particularly if there are privacy implications for your users.
User information is used to show you which errors are impacting the most users. Set your own user identifiers if you want to be able to find errors affecting individual users.
If no user ID is set on the Bugsnag
client, a Bugsnag-generated Device ID is used for the user.id
property of BugsnagEvent
and BugsnagSession
objects. To prevent collection, set an initial value in the Bugsnag
client or update the data in an event callback and a session callback block.
Information about the device can be useful to identify if an error is only occurring on some devices.
To see the data collected about a user’s device, see the device
property of the BugsnagEvent
and BugsnagSession
objects. To prevent collection, update the data in an event callback and a session callback block.
In addition, the following data is collected and added to the metadata
field of a BugsnagEvent
. This data can be removed by clearing the following keys from metadata
:
Section | Key | Description |
---|---|---|
device |
batteryLevel |
Amount of battery charge available at time of report |
device |
simulator |
A boolean value which is true if the device is a simulator |
device |
charging |
A boolean value which is true if the device is charging its battery |
device |
wordSize |
Word size of OS (32-bit or 64-bit) |
device |
thermalState |
The device’s thermal condition |
device |
timezone |
The device’s timezone |
For watchOS unhandled errors, battery values will be the launch time values.
Information about the application can be useful to identify if an error occurs in certain versions.
To see the data collected about your app, see the app
property of the BugsnagEvent
and BugsnagSession
classes. To prevent collection, update the data in an event callback and a session callback block.
In addition, the following data is collected and added to the metadata
field of a BugsnagEvent
. This data can be removed by clearing the following keys from metadata
:
Section | Key | Description |
---|---|---|
app |
freeMemory |
How much additional memory the app may allocate before reaching its memory limit, as reported by os_proc_available_memory() |
app |
memoryLimit |
The app’s memory limit |
app |
memoryUsage |
The app’s memory footprint |
app |
name |
The name of the executable, set from CFBundleExecutable |
Modifying error information may affect error grouping.
To see the data collected about a captured error/signal, see the errors
property of the BugsnagEvent
class. To prevent collection, update the data in an event callback block.
Additional data is added to a metadata tab where possible. An nserror
tab is created for NSError
objects (including Swift errors) passed to notifyError
. It will contain:
Section | Key | Description |
---|---|---|
nserror |
code |
The error code (error.code ) |
nserror |
domain |
The error domain (error.domain ) |
nserror |
reason |
The error’s failure reason ( error.localizedFailureReason ) |
nserror |
userInfo |
The error’s user info dictionary (error.userInfo ) |
An uncaught NSException
or C++ exception will have an error
metadata tab that contains (where applicable):
Section | Key | Description |
---|---|---|
error |
address |
The memory address that was being accessed when the exception was thrown |
error |
crashInfo |
The message from the crashing library’s __crash_info section |
error |
nsexception , cpp_exception |
A dictionary of details about the original exception |
error |
reason |
The reason for the error |
error |
type |
The error type (nsexception or cpp_exception ) |
Breadcrumbs are automatically recorded for common actions and can be helpful to reproduce errors.
The following breadcrumbs are collected and can be filtered/amended in a breadcrumb callback block or disabled by its type using enabledBreadcrumbTypes
:
Data | Type | Description |
---|---|---|
NSProcessInfoThermalStateDidChangeNotification |
State | Notification when the thermal state of the device changed |
NSUndoManagerDidUndoChangeNotification |
State | Notification when an undo operation occurs |
NSUndoManagerDidRedoChangeNotification |
State | Notification when a redo operation occurs |
NSHTTPURLResponse |
Request (success) | HTTP Response status code in range 100 - 399 |
NSHTTPURLResponse |
Request (failed) | HTTP Response status code in range 400 - 499 |
NSHTTPURLResponse |
Request (error) | HTTP Response status code not in range 100 - 499 or no response received |
Request type breadcrumbs are only captured when the BugsnagNetworkRequestPlugin
is installed and enabled.