Using End to End Tracing to Troubleshoot and Diagnose Device Problems

Follow this sequence to record device-initiated end to end trace information.

Prerequisites
  1. The client must be configured to use end to end tracing by configuring the client to use the supportability-related tracing APIs, and the trace level  must be set to a value other than NONE.  For example, SAP Mobile Server retrieves the appropriate properties set in the SAP Passport that are transported as an HTTP header in the request. For more information, see the Developer Guide for your platform.
  2. For REST API applications, the business transactions configured for tracing must be uploaded using the Business Transaction XML (BTX). For more information, see the Developer Guide for REST API Applications.
Task
  1. The System Administrator  creates a logging profile for a given application connection ID based on the users information.
    Enable end to end tracing by selecting the application connection ids of interest in the Domain Logging Profile's Application connections screen for new or existing domain logging profiles. The System Administrator can either:
    • Create a new domain logging profile from SAP Control Center
      1. In the navigation pane of SAP Control Center, select Domains > <domainName> > Log.
      2. In the right administration pane, select the Settings tab.
      3. Click New to open the profile definition dialog.
      4. Select Application Connections, select Application Connection ID as your search criteria, select the application connections you intend to trace and click OK.
      5. Select Enable after creation and click OK.
    • Modify an existing domain logging to include the application connections you want to trace in the “Application connections” filter of the profile. Verify that the domain logging profile is enabled.
  2. The user initiates tracing on the device.
  3. The user performs the transaction that requires tracing.
  4. The user turns off tracing on the device.
  5. The user uploads the generated Business Transaction XML to the SAP Solution Manager.
  6. The device
  7. The System Administrator filters the server log by root context ID and transaction ID, as provided by the application.
    The transaction id and root context id fields are used to trace a given request. The field values should be saved in all modules where trace data is required. Each request made to the server has a different transaction id and all requests within a given session have the same root context id. Each such session has different root context ids. For example, consider the following snippet of client code:
    E2ETraceTestDB.Synchronize();
    int id = 121;
    Customer customer = new Customer();
    customer.Fname = "Ritchie";
    customer.Lname = "Dennis";
    customer.Id = id;
    customer.City = "CA";
    customer.Save();
    customer.SubmitPending();
    E2ETraceTestDB.Synchronize();
    

    For the above code, the log messages in a typical domain log table can be represented as given below. Here the logs resulting from each synchronize() server call includes a unique TransactionID but both calls include the same RootContextID:

    Transaction and Root Context ID Logging
    LogID RootContextID TransactionID LogMessage
    1 4635000000311EE09EC5037310AE97A2 4635000000311EE09EC5037310AE77A2 Msg1 for sync1
    2 4635000000311EE09EC5037310AE97A2 4635000000311EE09EC5037310AE77A2 msg2 for sync1
    3 4635000000311EE09EC5037310AE97A2 4635000000311EE09EC5037310AE77A2 msg3 for sync1
    n+1 4635000000311EE09EC5037310AE97A2 4635000000311EE09FG5037310BD99A2 msg1 for sync2
    n+2 4635000000311EE09EC5037310AE97A2 4635000000311EE09FG5037310BD99A2 msg2 for sync2
  8. View the server log. The trace level set in the passport by the client devices determines the amount of end to end tracing captured in these logs:
    • Domain logs
    • Payload logs
    • Performance logs
    • SAP Mobile Platform log level
    End to end trace levels are determined by the application's trace level setting:
    Trace Levels
    Trace Level Enable Domain Log Enable Payload Log Enable Performance Log Override SAP Mobile Platform Log Level
    NONE No No No No
    LOW Yes No No INFO
    MEDIUM Yes No Yes INFO
    HIGH Yes Yes No DEBUG

    When the trace level is NONE, the system behaves as if SAP Passport is not set and end to end tracing is disabled. The overridden configuration is in effect only for the current thread (context), so the configuration remains unaffected for other application connections for which trace is not enabled. When end to end tracing is enabled, the log level set against all buckets (modules) in SAP Mobile Platform is overridden to the one given above as determined by the trace level.