Skip to Content

Step by Step with the SAP Cloud Platform SDK for Android

Part 12 — Server Logging and Tracing

Previous (Trace Client Network Requests)   Home

The below examples will modify the server’s log levels to log more information, record a server trace, and demonstrate how to use Fiddler to view the recorded trace.
Change Log Levels
Record a Server Trace
Use Fiddler to View the Recorded Trace

Change Log Levels

The log level of the Offline component of Mobile Services will be changed to the debug log level and events will be included in the log.

  1. In the SAP Mobile Cockpit, select Settings > Log Settings.
  2. Under Component Settings, change the log level the Offline component to DEBUG, check Event Logs and press the Save button.
    We should now see more information about the Offline component when it is used by the app.
  3. In the app, tap the Sync button.
  4. Go to Analytics > Logs.
    Notice that the event log is available from the Sync operation as shown below. Note it may take a few minutes for the logs to appear.

    The debug logs for the offline component are available under the Technical Logs tab.

Record a Server Trace

In this step, a trace of the server’s network calls will be recorded during a sync.

  1. In the Mobile Cockpit, go to Analytics > Network Traces and click Start Recording.
  2. Go to the app and tap on the Sync button.
  3. Click on Stop Recording.
  4. Under the Download section, set the Download Type to HAR and click Download.

Use Fiddler to View the Recorded Trace

Now that the trace has been recorded, it can be viewed in Fiddler.

  1. In Fiddler, go to File > Import Sessions…, set the dropdown menu to HTTPArchive and press Next.
  2. Select the downloaded file and press Open.You should see the server’s request made to the backend due to the mobile app’s sync request.

    Note that products is being requested as that was the entity that was specified in the method setupOfflineOData in the below line.

    
    OfflineODataDefiningQuery myDefiningQuery = new OfflineODataDefiningQuery("Products", "Products", false);

Previous (Trace Client Network Requests)   Home

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply