Add custom data to crash reports
Add custom data to crash reports
Although Splunk MINT collects plenty of data associated with each crash of your app, you can collect additional custom crash data. To add custom data to your crash reports, use the extra data map.
When displaying custom data in MINT Management Console, the data is truncated at 128 characters. The full value is displayed in the Splunk MINT App.
- To add custom data as a key-value pair, use the addExtraData: selector as follows:
- To access the global LimitedExtraDataList with the [Mint sharedInstance].extraDataList property:
- To remove a specific value from the extra data, use the removeExtraDataWithKey: method.
- To clear the extra data completely, use the clearExtraData: method.
// Objective-C [[Mint sharedInstance] addExtraData:[[ExtraData alloc] initWithKey:@"Global Extra Key1" andValue:@"Global Extra Value1"]];
// Swift Mint.sharedInstance().addExtraData(ExtraData(key: "Global Extra Key1", andValue: "Global Extra Value1"))
The addExtraData selector accepts an ExtraData class instance, which you can initialize using the custom initializer initWithKey:andValue: to pass custom values.
This method adds an instance to the global LimitedExtraDataList global singleton instance object and sends appropriate values to the Splunk MINT server as key-value pairs, which you can then examine your request.
// Objective-C [[Mint sharedInstance].extraDataList addWithKey:@"test1" andValue:@"testValue1"];
// Swift Mint.sharedInstance().extraDataList.addWithKey("Test1", andValue: "TestValue")
This usage gives the same result as the addExtraData: method of the Mint instance because both methods access the same global LimitedExtraDataList singleton instance. The LimitedExtraDataList is an object that is limited to a maximum count of 32 objects. If you try to add an object that exceeds this count, the first object in the list is removed, FIFO. You can't add multiple values with the same key. If you try, you will not get an error but the value of an existing key will change.
View custom crash data
To view the custom crash data in Splunk MINT Management Console:
- Go to the Errors dashboard and select an error.
- In the error details section, click the Error Instances tab.
- In the Show All column, click the arrow.
To view the custom data for all of your mobile apps, run a search in the Splunk MINT App. For example, the following search lists errors with the values of the custom "level" field:
sourcetype=mint:error | table message, extraData.level
For more about running searches in MINT, see Searches in the Splunk MINT App User Guide.
Report handled exceptions | Add breadcrumbs to crash reports |
This documentation applies to the following versions of Splunk MINT™ SDK for iOS (EOL): 4.1.x, 4.2.x, 4.3.x, 4.4.x
Feedback submitted, thanks!