Troubleshoot single request issues
1. Capture client requests
Use tools such as Charles (recommended) or Fiddler to capture client packets. A packet capture tool lets you view key data from Remote Procedure Call (RPC) requests.
The following is an example of a packet capture:
Sample request header:

Sample response header:

2. Query MGS logs by TraceId (for Apsara Stack only)
Retrieve the Mgw-TraceId from the response header.
In the mPaaS console, go to the Mobile Gateway Service > Gateway management> Tools > Trace analysis page. Enter the TraceId to find the IP address of the MGS server that processed the request and the processing time.
Connect to the MGS server using Secure Shell (SSH). Use the TraceId to query the logs related to the request.
ssh -p2022 account@IP account/password cd /home/admin/logs/gateway grep #traceid# *.logAnalyze the logs. For more information, see Gateway log description and Gateway result code description.
Troubleshoot cluster GREP issues (for Apsara Stack only)
To search for a log in the MGS cluster, use the open source pssh tool.
Download the pssh tool.
Export the list of all MGS server IP addresses from the Gamma platform to the
mgs_host.txtfile, as follows:log@10.2.216.33:2022 log@10.2.216.26:2022 log@10.2.216.25:2022Run the following command:
pssh -i -h mgs_host.txt -A -P 'grep "xxxx" /home/admin/logs/gateway/xxx.log'