The mPaaS client SDK provides an interface for writing diagnostic logs that can be used for development or troubleshooting. By default, these logs are saved to the disk and are not uploaded.
To troubleshoot problems, you can use the log fetch feature to send a diagnostic task to the client. The client receives the task and uploads the logs to the server. You can then download the logs from the Mobile Analysis console.
Prerequisites
Before you pull real-time logs, ensure that you have completed the client diagnostic log instrumentation. For more information, see HarmonyOS NEXT client diagnostics.
To pull diagnostic logs through the Push channel, you must first integrate the Push component. Then, configure the pass-through message Ability to ensure that pass-through messages can be received. For more information, see Configure the pass-through message Ability.
To pull diagnostic logs through the Sync channel, you must first integrate the Sync component and ensure that Sync messages can be received.
Pull logs
To pull and download logs:
Log on to the mPaaS console. In the navigation pane on the left, choose Mobile Analysis > Log Management > Pull Real-time Log.
Click the Add button. On the Create Diagnostic Task page, enter the required task details.
After entering the task information, click the OK button to create a diagnostic task.
In the diagnostic task list, find the task that you just created. Select a Trigger Channel and click the Trigger button to send the task. The task status on the page is updated after the task is sent.
The trigger channel must match the client's diagnostic connection method. For example, if the diagnostic method is Message Push, the trigger channel must be Via Message Push (Push).
The client receives the diagnostic task and uploads the logs to the server. The task status changes to Completed. Click the View button to open the subtask details page, and then click the Download button to download the logs.