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 Sentry DSN 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.
UE4 Crash reporter
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:
Include the UE4 Crash Reporter
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.
Include Debug Information
The option is also located under Project > Packaging menu, then select show advanced followed by
checking the box for:
Include Debug Files.
Add the Sentry DSN
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 DSN (Data Source Name) 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="___UNREAL_URL___"
Upload Debug Symbols
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.
Note that for all libraries where you’d like to receive symbolication, you need to provide debug information. This includes dependencies and operating system libraries. If you are not sure which files are required, go to Project Settings > Processing Issues, which shows a list of all the necessary files and instructions to retrieve them.
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.
Event Attachments (Preview)
The files within the crash uploaded to Sentry can be persisted using Event Attachments. Unless Event Attachments is enabled, Sentry will only use the files to create the event and subsequently will drop the files.
In order to keep the original log and context files, make sure to enable the Event Attachments feature in your Sentry project.
The organization and project setting Store Native Crash Reports also enables storage of the original minidump files. For data privacy reasons, this setting is by default disabled. Raw minidumps are deleted permanently with their issues or after 30 days.