get-logs 接口
获取系统日志列表,系统最多记录最近 1000 条数据,仅管理员有权限。
请求方式
GET http://ip/mwapi?method=get-logs&types=xxx,xxx,xxx
| 参数 | 
说明 | 
| method | 
方法名称:get-logs | 
| types | 
日志类型,有效值:all、info、warn、error,当有多个类型时用英文逗号隔开。 | 
返回数据
{
  "status": 0,
  "logs": [
    {
      "type": "warn",
      "time": "2019-03-19 09:53:03.047",
      "message": "USB state: disconnected"
    },
    {
      "type": "warn",
      "time": "2019-03-19 09:14:09.292",
      "message": "User 'Admin' (192.168.66.2) session 4 timeout"
    },
    {
      "type": "warn",
      "time": "1970-01-01 00:00:11.872",
      "message": "USB state: disconnected"
    },
    ...
  ]
}
| 属性 | 
说明 | 
| status | 
返回状态。0:数据获取成功,返回其它值请参考 API 状态码。 | 
| logs | 
日志数组列表:type:日志类型;time:日志产生时间,message:日志内容。 | 
接口示例
获取全部日志
http://192.168.66.1/mwapi?method=get-ptz-configmethod=get-logs&types=all
获取 warn 和 error 类型的日志
http://192.168.66.1/mwapi?method=get-ptz-configmethod=get-logs&types=warn,error