Generally, Charles (recommended) or Fiddler tool is used to capture client-side packets. With the packet capture tool, you can find some critical data of the RPC requests.
Here is an example of packet capture:
Example of request header:
Example of response header:
- Obtain Mgw-TraceId from the response header.
- In mPaaS console, select the target App, go to the Mobile Gateway > Manage gateway> Tools > Trace analysis page, and enter the TraceId to parse the corresponding MGS server IP and processing time of the request.
- Connect MGS server through SSH, and then query the request-related logs by TraceId.
ssh -p2022 log@#ip# Account: log/mpaas123456
grep #traceid# *.log
- Analyze logs according to the Gateway logs and Gateway result codes.
Sometimes, you may need to search a certain log in MGS cluster. At this time, you can use the open-source PSSH tool.
- Download PSSH tool.
Export the server IP list of MGS from Gamma platform to
mgs_host.txtfile, for example:
- Run the following command:
pssh -i -h mgs_host.txt -A -P 'grep "xxxx" /home/admin/logs/gateway/xxx.log'