Basic configuration

The configuration settings for the Backtrace client and database are defined by the Backtrace Configuration file in the Assets folder of your Unity project. It's recommended to change the configuration settings for the Backtrace client and database in the Unity Inspector:

Alternatively, you can also specify the configuration settings in your C# project.

Enable Stack traces for WebGL

  1. Open your project in the Unity Editor.
  2. From the Unity Editor menu, select Edit > Project Settings.
  3. Under Publishing Settings, set Enable Exceptions to Full With Stacktrace.

Backtrace client settings

SettingDescriptionTypeDefault
Server address

The server address (submission URL) is required to submit exceptions from your Unity project to your Backtrace instance.

The server address can be generated in Settings > Error Submission > Submission tokens > Generate server address in action menu and will be in the following format: https://submit.backtrace.io/{subdomain}/{submission-token}/json.

String 
Handle unhandled exceptionsHandles unhandled exceptions that aren’t captured by try/catch statements.BooleanTrue
Reports per minute

Limits the number of reports the client will send per minute.

  • If set to '0', there is no limit.

  • If set to a value greater than '0' and the value is reached, the client will not send any reports until the next minute.

The BacktraceClient.Send and BacktraceClient.SendAsync methods will return 'false'.

Number50
Ignore SSL validationBy default, Unity validates SSL certificates. If you don't want to validate SSL certificates, set the value to 'true'.BooleanFalse

Backtrace database settings

SettingDescriptionTypeDefault
Enable databaseEnables an offline database to store reports locally.BooleanFalse
Backtrace database pathSpecifies the absolute path that the local database will use to store reports for your game or app. Note that the Backtrace database will remove all existing files in the database directory when the client is first initialized. You can use interpolated strings such as ${Application.persistentDataPath}/backtrace/database.String 
Client-side deduplication

Aggregates duplicated reports. The available options are:

  • Disable: Duplicated reports are not aggregated.

  • Everything: Aggregates by faulting callstack, exception type, and exception message.

  • Faulting callstack: Aggregates based on the current stack trace.

  • Exception type: Aggregates by stack trace and exception type.

  • Exception message: Aggregates by stack trace and exception message.

EnumDiasble
Attach Unity player.logAttaches the Unity player log file to the Backtrace report. Available only for Windows and macOS.BooleanFalse
Auto send mode

Sends reports to the server based on the retry settings described below.

If the value is set to 'False', you can use the Flush or Send methods as an alternative.

BooleanTrue
Create database directoryCreates the offline database directory if the provided path doesn't exist.BooleanTrue
Attach screenshotGenerates a screenshot and creates an attachment of the frame when an exception occurs in a game scene.BooleanFalse
Maximum number of recordsThe maximum number of reports stored in the offline database. When the limit is reached, the oldest reports are removed. If the value is equal to '0', then no limit is set.Integer8
Maximum database size (mb)The maximum database size in MB. When the limit is reached, the oldest reports are removed. If the value is equal to '0', then no limit is set.Integer0
Retry intervalThe amount of time (in seconds) to wait between retries if the database is unable to send a report.Integer60
Maximum retriesThe maximum number of retries to attempt if the database is unable to send a report.Integer3
Retry order (FIFO/LIFO)

The order in which reports are sent to the Backtrace server:

  • If you set the value to Queue (FIFO), then the first report into the queue is the first report to leave the queue.

  • If you set the value to Stack (LIFO), then the last report into the stack is the last report to leave the stack.

EnumStack

Advanced client settings

SettingDescriptionTypeDefault
Use normalized exception messageGenerates a fingerprint with a normalized exception message if an exception doesn't have a stack trace.BooleanFalse
Send unhandled native game crashes on startupSends native crashes when the game or app starts. Available only for Windows.BooleanTrue
Filter reports

Ignores managed error reports based on error type:

  • Disable: Sends error reports for all error types.

  • Everything: Ignores error reports for all error types.

  • Message: Ignores error reports for error messages.

  • Handled Exception: Ignores error reports for handled exceptions.

  • Unhandled Exception: Ignores error reports for unhandled exceptions.

  • Hang: Ignores error reports for ANR (application not responding) or hang errors. Mobile only.

  • Game Error: Ignores error reports for game crashes in the managed environment.

EnumDisable
Collect last n game logsCollects the last n number of logs generated in the game.Integer10
Enable performance statisticsAllows the Backtrace client to measure execution time and include performance information as report attributes.BooleanFalse
Destroy client on new scene loadRemoves the Backtrace client component when loading a new game scene. By default, the Backtrace client will be available in every game scene.BooleanFalse
Log random sampling rate

The rate at which random sample reports for DebugLog.error messages are sent to Backtrace.

By default, 1% of the DebugLog.error messages will be sent to Backtrace. To send all DebugLog.error messages to Backtrace, set the value to '1'.

Decimal0.01
Game object depth limitFilters the number of GameObject children in Backtrace reports.Integer-1
Disable error reporting integration in editorIgnores errors encountered while the project is running in the Unity Editor and only reports errors encountered in a build.BooleanFalse

Crash-free metrics reporting

Once enabled, unique application launches and unique player identifiers (default: guid) will be submitted to Backtrace so you can get an overview of how many errors, hangs, crashes, and memory problems occur compared to all active users for a given platform, version, and more.

Note: This functionality is supported on all platforms except WebGL.

SettingDescriptionTypeDefault
Enable crash free metrics reportingEnables metrics such as crash free users and crash free sessions.BooleanTrue
Auto send interval in min

Indicates how often crash free metrics are sent to Backtrace.

By default, session events are sent on application startup, when the game ends, and every 30 minutes while the game is running.

Integer30

Native support

Use the Backtrace Unity SDK to capture native crashes for:

Android settings

The Backtrace Unity SDK includes support for capturing native crashes, as well as memory and process information from the underlying Android OS, JNI, and NDK layers, including the following attributes:

  • system.memory.free
  • system.memory.swap.free
  • system.memory.vmalloc.total
  • sched.cs.involuntary
  • sched.cs.voluntary
SettingDescriptionTypeDefault
Capture native crashesCaptures and symbolicates stack traces for native crashes. A crash report is generated, stored locally, and uploaded on the next game start.BooleanTrue
Capture ANR (application not responding)Generates an error report whenever an app hangs for more than 5 seconds. The error.type for these reports will be Hang.BooleanTrue
Send Out of Memory exceptions to BacktraceDetects low memory conditions. If the app crashes due to a memory condition, a crash report will be submitted with the memory.warning and memory.warning.date attributes.BooleanFalse
Enable client-side unwindingEnables callstack unwinding. If you're unable to upload all debug symbols for your app, you can use this setting to get debug information. Available only for supported versions of Android (NDK 19; Unity 2019+). You can also enable this setting with the BacktraceConfiguration object and the .ClientSideUnwinding = true; option.BooleanFalse
Symbols upload tokenRequired to automatically upload debug symbols to Backtrace. To generate a symbol upload token, in the Cloud Diagnostics Advanced dashboard, go to Project Settings > Symbols > Access tokens > and select + to generate a new token.String 

Uploading debug symbols

You can configure the Backtrace client to automatically upload debug symbols in IL2CPP builds for Android apps.

  1. Open your project in the Unity Editor.
  2. From the Unity Editor menu, select File > Build Settings.
  3. In the Build Settings, set Create symbols.zip to Debugging.

4. From the Build Settings, select Player Settings.

5. In the Player Settings, search for “Scripting Backend”.

6. Under Configuration (in Other Settings), set Scripting Backend to IL2CPP.

For more information about debug symbols, see Debug symbols.

iOS settings

The Backtrace Unity SDK includes support for capturing native crashes, as well as memory and process information from the underlying iOS layer, including the following attributes:

  • system.memory.free
  • system.memory.swap.used
  • system.memory.total
  • system.memory.active
  • system.memory.inactive
SettingDescriptionTypeDefault
Capture native crashesCaptures and symbolicates stack traces for native crashes. A crash report is generated, stored locally, and uploaded on the next game start.BooleanTrue
Capture ANR (application not responding)Generates an error report whenever an app hangs for more than 5 seconds. The error.type for these reports will be Hang.BooleanTrue
Send Out of Memory exceptions to BacktraceDetects low memory conditions. If the app crashes due to a memory condition, a crash report will be submitted with the memory.warning and memory.warning.date attributes.BooleanFalse
Enable client-side unwinding

Enables callstack unwinding. If you're unable to upload all debug symbols for your app, you can use this setting to get debug information. Available only for supported versions of Android (NDK 19; Unity 2019+).

You can also enable this setting with the BacktraceConfiguration object and the .ClientSideUnwinding = true; option.

BooleanFalse

Diasble the CrashReport API

The CrashReport API might prevent the Backtrace client from sending native crashes for iOS.

  1. Open your project in the Unity Editor.
  2. From the Unity Editor menu, select File > Build Settings.
  3. From the Build Settings, select Player Settings.
  4. In the Player Settings, search for “CrashReport API”.
  5. Under Crash Reporting (in Debugging and crash reporting), make sure Enable CrashReport API Backend is disabled.

Uploading debug symbols

When building your iOS game in Xcode, make sure to configure the build settings to generate dSYM files for any build that you want to debug. By default, Xcode may only generate DWARF files.

  1. In Xcode, go to your project target's Build Settings.
  2. Under Build Options, set Debug Information Format to DWARF with dSYM File.

You can find the dSYM files in the Build folder for your project (.../Build/Products/<build target folder>), which you can then compress into a .zip file and upload to Cloud Diagnostics Advanced.

For more information about debug symbols, see Debug symbols.

Windows settings

The Backtrace Unity SDK includes support for capturing native Windows crashes.

SettingDescriptionTypeDefault
Minidump typeThe type of memory information to capture from Windows minidump reports.EnumNone
Capture native crashesCaptures and symbolicates stack traces for native crashes. A crash report is generated, stored locally, and uploaded on the next game start.BooleanTrue
Capture ANR (application not responding)Generates an error report whenever an app hangs for more than 5 seconds. The error.type for these reports will be Hang.BooleanTrue

Logging breadcrumbs

SettingDescriptionTypeDefault
Enable breadcrumbs support

Enable breadcrumbs support logs breadcrumb events, such as the app going to a background process, logging messages, network connectivity lost, and more.

By default, breadcrumbs are limited to 64kB and older events will automatically be removed.

Enum

False

Breadcrumbs event typeSpecifies which type of events to log.BooleanEverything
Breadcrumbs log levelSpecifies which log level severity to include.BooleanEverything

You can also add custom breadcrumb events, with information like "player completed a level" and sub attributes:

GetComponent<BacktraceClient>().Breadcrumbs.Info("Player Base Upgraded", new Dictionary<string, string>() {
				{"base.name", "MtGox"},
				{"base.level", "15"}
			});