All Products
Search
Document Center

Mobile Platform as a Service:Extract real-time logs

Last Updated:Jun 28, 2023

The client SDK of mPaaS provides an interface to write diagnostic logs. Diagnostic logs are logs written by calling tracking interface based on your development and troubleshooting requirements. By default, the diagnostic logs are recorded only on disk and not uploaded to server.

When you troubleshoot problems, you can assign a diagnosis task to the client to extract logs. After receiving the task, the client uploads the logs to server. Then, you can download logs from the server logs through the MAS console.

prerequisites

Before you extract logs, ensure that you have completed client diagnostic log tracking. About log tracking, see iOS client diagnosis and Android client diagnosis.

Download server logs

Complete the following steps to download server logs:

  1. Log in to the mPaaS console, and enter the Mobile Analysis Service > Log management >Extract real-time logs page.

  2. Click Add to create a diagnosis task and complete the task configuration.

    For Android diagnosis task, if you select the log type as Custom log path, then you should keep in mind the following two points when filling in the log path:

    • Make sure that the custom path points to a specific file, not a directory. If it is a file under the mobile SD card, then /storage/emulated/0/ must be added in front of the path, for example /storage/emulated/0/Android/data/com.mpaas.aar.demo.analytics/files/mdap/upload /log.txt.

    • The file path must include the app package name, for example, com.mpaas.aar.demo.analytics. In consideration of the code of conduct for apps, the package name must be consistent with the Package Name you filled in the Code configuration. No matter it is the file stored inside the app or the file in SD card, you should only pull log files in the app’s own directory.

  3. After you complete the task configuration, click OK to generate a diagnosis task.

  4. In the diagnosis task list, select the newly created task, and select the trigger channel which can be Sync or Push, and then click Trigger to trigger the task. When the task is successfully assigned, you can see the task status on the page updated.

    The trigger channel should be consistent with your client’s diagnosis method. Namely, if the client adopts Mobile Sync Service to pull diagnostic logs, the trigger channel must be Sync; if the client adopts Message Push Service to pull diagnostic logs, the trigger channel must be Push.

  5. After the client receives the diagnosis task, the client uploads the logs to the server and updates the task status to Processed. Then, you can click View to go to the subtask page, and click Download to download the logs.