GET管理接口

查询日志列表

按项目查询日志,支持级别、平台、时间范围与关键字筛选。默认不返回已隐藏的日志, `include_hidden=true` 时一并返回。

URL

/api/v1/admin/projects/{projectKey}/logs

鉴权方式

需要管理员 JWT 或 API Key,二者等价(Authorization: Bearer <token>)

请求参数

Path 参数

名称类型必填说明
projectKeystring项目主键 project_key(大小写不敏感)

Query 参数

名称类型必填说明
limitinteger分页大小
offsetinteger分页偏移
start_timeintegerUnix 时间戳(秒)
end_timeintegerUnix 时间戳(秒)
levelinteger0=debug, 1=info, 2=warn, 3=error
platformwindows | linux | macos | ios | android | web | others按平台筛选列表内容(不是客户端平台声明,与请求统计无关)。 对版本与公告这类有发布范围的资源,未限定平台的记录对任何平台都可见。
searchstring关键字,不区分大小写地匹配 content、ip、city、country_name、region_name 与 platform_version;device_info / custom_data 为 JSON 列,不参与匹配。
include_hiddenboolean是否连已隐藏的日志一起返回。

Header 参数

名称类型必填说明
AuthorizationstringBearer <管理员 JWT 或 API Key>

该接口无需请求体。

响应示例

200 响应

{
  "total": 1,
  "data": [
    {
      "id": "log-001",
      "level": 2,
      "content": "更新检查请求超时,已重试。",
      "device_info": {
        "os": "Windows 11",
        "arch": "x64"
      },
      "custom_data": {
        "app_version": "1.2.0"
      },
      "is_hidden": false,
      "ip": "203.0.113.9",
      "user_agent": "verhub-sdk/1.0",
      "country_code": "CN",
      "country_name": "中国",
      "region_name": "广东省",
      "city": "深圳",
      "platform": "windows",
      "created_at": 1760000000
    }
  ]
}
GET

Try It Out

请求 URL 预览

/api/v1/admin/projects/verhub/logs?limit=20&offset=0&start_time=1760000000&end_time=1762000000&search=timeout&include_hidden=false