May 20, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the Service Side API.
Real-time log queries
GET https://api.weixin.qq.com/wxaapi/userlog/userlog_search?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
date | string | Is | Dates in YYYYMMDD format, only the last 7 days are supported | |
begintime | number | Is | The start time, which must be the time of the date specified by date | |
endtime | number | Is | The end time, which must be the time specified by date | |
start | number | 0 | Whether | The data substation that starts returning is used as a page, which defaults to 0 |
limit | number | 20 | Whether | The number of data bars returned, used as pedding, defaults to 20 |
traceId | string | Whether | The unique ID that the applet starts, and pressing the TraceId query shows logs of all pages of the small program startup process. | |
Url | string | Whether | Small program page paths, such as pages/index/index | |
Id | string | Whether | User microsyscope or OpenId | |
filterMsg | string | Whether | The developer specifies the filter Msg field through setFileter Msg/addFilter Msg | |
level | number | Whether | Log level, which returns logs greater than or equal to the level, level is defined as 2 (Info), 4 (Warn), 8 (Error), and if specified as 4, logs greater than or equal to 4 are returned, i.e. Warn and Error logs are returned. |
Property | Type | Description |
---|---|---|
data | Object | The total number of log data and log bars returned |
list | Array.<Object> | The list of log data returned |
errcode | number | WeChat side error code, return when the order fails |
errmsg | string | WeChat side error message, return when the order fails |
The structure of the list
Property | Type | Description |
---|---|---|
level | number | The log level is the result of all the level fields or actions in the msg array. For example, if there are two logs in the msg array, Info (value 2) and Warn (value 4), the level value is 6 |
libraryVersion | string | The underlying library version |
clientVersion | string | The client version |
Id | string | WeChat user OpenID |
timestamp | number | Unix timestamp for logging |
platform | number | 1 Android 2 IOS |
Url | string | A link to the small program page |
msg | Array.<Object> | An array of log contents, log.info, etc. exist here |
traceid | string | The unique ID that the applet starts, and pressing the TraceId query shows logs of all pages of the small program startup process. |
filterMsg | string | WeChat user OpenID |
The structure .msg the list
Property | Type | Description |
---|---|---|
time | number | log.info time of the call |
msg | Array.<string> | log.info the contents of the call, each argument is an item of the array |
level | number | log.info the log level of the call |
The legal value of errcode
Value | Description | The lowest version |
---|---|---|
-1 | The system failed | |
200002 | Argument error, date, begintime, endtime required. Date can only be the date of the last three days, endtime must be larger than begintime | |
200010 | Operations are too frequent and are currently limited to 50 per minute | |
200007 | No permissions |
The query was successful: "errcode": 0, "errmsg": "", "data": "list": "level": 6, "platform": 1, "libraryVersion": "2.8.3", "clientVersion": "7.0.7", "id": "oXu034-Kl5Et2U0exKDsFaon0Q", "timestamp": 1570852796, "msg": "time": 1570852795, "msg": "hello world", "level": 2," "time": 157085 2795, "msg": "get msg list mig 10006", "level": "4", "url": "pages/chat/chat", "traceid": " oXu03410akoNqfsrMMswk6Zwwl1U_1570852656", "filterMsg": "NetworkExceed08 ReportTimeTotal" }], "total": 1000 } }