The mPaaS client-side software development kit (SDK) provides an interface for writing diagnostic logs. These logs are generated by calling instrumentation interfaces and are used for development or troubleshooting. By default, these logs are saved only to the disk and are not uploaded.
To troubleshoot issues, you can use the log fetching feature to send a diagnostic task to the client. After the client receives the task, it uploads the logs to the server. You can then download the logs from the Application Analysis console.
Prerequisites
Before pulling real-time logs, ensure that you have completed client-side diagnostic log instrumentation. For more information, see iOS client diagnostics and Android client diagnostics.
Download server-side logs
To download server-side logs:
Log on to the mPaaS console. In the left navigation pane, choose Mobile Analysis > Log Management > Pull Real-time Logs.
Click the New button to open the Create Diagnostic Task page, and then configure the diagnostic task as prompted.
When you configure a diagnostic task for the Android platform, if you set the log type to Custom Pull Path, note the following requirements for the custom path:
The custom path must point to a single file, not a folder. If the file is on the device's SD card, prepend
/storage/emulated/0/to 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 application package name, such as
com.mpaas.aar.demo.analytics. For application behavior compliance, this package name must match the Package Name specified in the code configuration. You can pull files only from the application's directory, regardless of whether the file is in internal storage or on an SD card.
After you configure the diagnostic task, click OK to create the task.
In the diagnostic task list, select the task that you just created, choose a Trigger Channel, and then click Trigger to send the task. After the task is sent, its status is updated on the page.
The trigger channel must match the method that the client uses for diagnostics. If the client uses data synchronization, select Trigger via data synchronization (Sync). If the client uses message push, select Trigger via message push (Push).
After the client receives the diagnostic task and uploads the logs, the task status changes to Processing complete. You can then click View to open the subtask page and click Download to download the logs.