Unreal Engine 4
Installation of a Sentry SDK is not required in order to capture the crashes of your UE4 application or game. Sentry supports the UE4 Crash Reporter.
To integrate your UE4 game or application with Sentry, the following steps are required:
- Include the UE4 Crash Reporter to your game or application.
- Include Debug information in the crash reports.
- Add the Unreal Engine Endpoint to the relevant configuration file.
- Upload your games symbols so Sentry can display function names and line numbers.
- Optionally enable Event Attachments for your Sentry project.
Below we'll break down each step in detail.
The UE4 Crash Reporter is provided out of the box by Epic Games. It is able to collect relevant information about the crash and send it to a service like Sentry to process.
Adding it to your game means that in case a crash happens, the following dialog is displayed to the user:
You can add the Crash Report Client to your game in your Project Settings.
The simplest way is to search the option:
The option is located under Project > Packaging menu, then select show advanced followed by
checking the box for:
Include Crash Reporter.
To get the most out of Sentry, crash reports are required to include debug information. In order for Sentry to be able to process the crash report and translate memory addresses to meaningful information like function names, module names and line numbers, the crash itself must include debug information and also, symbols need to be uploaded to Sentry.
The option is also located under Project > Packaging menu, then select show advanced followed by
checking the box for:
Include Debug Files.
Now that the Crash Reporter and Debug Files are included, UE4 needs to know where to send the
crash. For that, we add the Sentry Unreal Engine Endpoint from the Client Keys settings page to game's configuration file. This will
include which project within Sentry you want to see the crashes arriving in real time.
That's accomplished by configuring the
CrashReportClient in the DefaultEngine.ini file.
Edit the file:
Add the configuration section:
[CrashReportClient] CrashReportClientVersion=1.0 DataRouterUrl="https://o0.ingest.sentry.io/api/0/unreal/examplePublicKey/"
To allow Sentry to fully process native crashes and provide you with symbolicated stack traces, you need to upload Debug Information Files (sometimes also referred to as Debug Symbols or just Symbols). We recommend uploading debug information during your build or release process.
For all libraries where you'd like to receive symbolication, you need to provide debug information. This includes dependencies and operating system libraries.
In addition to Debug Information Files, Sentry needs Call Frame Information (CFI) to extract accurate stack traces from minidumps of optimized release builds. CFI is usually part of the executables and not copied to debug symbols. Unless you are uploading Breakpad symbols, be sure to also include the binaries when uploading files to Sentry.
For more information on uploading debug information and their supported formats, see Debug Information Files.
The files within the crash uploaded to Sentry can be persisted using Event Attachments. Learn more about these in Attachments.
Event ingestion imposes limits on the size of UE4 crash reports. These limits are subject to future change and defined currently as:
- 20MB for a compressed request
- 100MB for the full crash report after decompression
For tips on troubleshooting the UE4 Crash Reporter, check out this thread in Sentry's forum where community members have delved into potential solutions.