Splunk MINT SDK for iOS (Legacy)

Splunk MINT SDK for iOS Developer Guide

Acrobat logo Download manual as PDF


This documentation does not apply to the most recent version of MintIOSSDK. Click here for the latest version.
Acrobat logo Download topic as PDF

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:
  • // 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.

  • To access the global LimitedExtraDataList with the [Mint sharedInstance].extraDataList property:
  • // 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.

  • To remove a specific value from the extra data, use the removeExtraDataWithKey: method.
  • To clear the extra data completely, use the clearExtraData: method.

View custom crash data

To view the custom crash data in Splunk MINT Management Console:

  1. Go to the Errors dashboard and select an error.
  2. In the error details section, click the Error Instances tab.
  3. 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.

Last modified on 12 January, 2016
PREVIOUS
Report handled exceptions
  NEXT
Add breadcrumbs to crash reports

This documentation applies to the following versions of Splunk MINT SDK for iOS (Legacy): 4.1.x, 4.2.x, 4.3.x, 4.4.x


Was this documentation topic helpful?

You must be logged into splunk.com in order to post comments. Log in now.

Please try to keep this discussion focused on the content covered in this documentation topic. If you have a more general question about Splunk functionality or are experiencing a difficulty with Splunk, consider posting a question to Splunkbase Answers.

0 out of 1000 Characters