Crashlytics Examples
This section demonstrates practical usage of Firebase Crashlytics in Unreal Engine projects. Crashlytics is designed to help you identify crashes, non-fatal errors, and unexpected states that occur on real user devices in production.
Unlike Analytics, Crashlytics is not intended for continuous or high-frequency logging. It should be used selectively to capture meaningful diagnostic information around errors and crashes.
All examples below are shown using Blueprint nodes, as this is the most common workflow. The same functionality is available through the corresponding C++ API.
All examples assume that Firebase has already been successfully initialized.
Logging Messages
Crashlytics allows you to attach log messages and report non-fatal errors that help diagnose issues leading up to a crash or unexpected behavior.
Writing Diagnostic Logs
Use Crashlytics Log to write diagnostic messages that describe the current state of the game. These logs are attached to crash and non-fatal reports and help reconstruct what happened before the issue occurred.
Typical use cases include:
- entering or leaving important game states
- starting potentially risky operations
- logging unexpected but recoverable conditions
Reporting Non-Fatal Errors
Use Crashlytics Record Non-Fatal to report errors that did not crash the game but represent incorrect or unexpected behavior.
Non-fatal errors should indicate real problems, not normal control flow.
Typical examples:
- failed data parsing
- invalid save data
- missing required configuration
Non-fatal reports appear in the Crashlytics dashboard alongside crashes and help identify issues that affect gameplay stability.
Setting User ID
Crashlytics allows you to associate crash reports with a specific user by setting a User ID.
Use Crashlytics Set User ID after the player profile or account has been initialized.
Common choices for User ID include:
- backend account ID
- platform-specific user identifier
- locally generated persistent ID
Setting a User ID makes it easier to track recurring issues affecting specific users.
Using Custom Keys
Custom Keys allow you to attach structured context data to Crashlytics reports. These keys are included with all subsequent crash and non-fatal reports until they are updated.
The plugin provides dedicated nodes for different key types:
- string
- integer
- boolean
Custom Keys should represent the current state of the application.
Typical examples include:
- current level or map
- game mode
- online or offline state
- save version
- build type
Custom Keys are especially useful when combined with diagnostic logs and non-fatal errors.
Important Notes
- Do not use Crashlytics as a general-purpose logging system
- Avoid logging data every frame or on high-frequency events
- Use non-fatal reports only for real errors
- Keep custom keys readable and stable
Correct usage of Crashlytics significantly improves your ability to debug and fix production issues.
Summary
Firebase Crashlytics provides detailed insight into crashes and errors occurring on real user devices.
By combining diagnostic logs, non-fatal error reporting, user identification, and custom keys, you can capture meaningful context that helps quickly identify and resolve stability issues in production builds.