GET管理接口
查询日志列表
按项目查询日志,支持级别、平台、时间范围与关键字筛选。默认不返回已隐藏的日志, `include_hidden=true` 时一并返回。
URL
/api/v1/admin/projects/{projectKey}/logs鉴权方式
需要管理员 JWT 或 API Key,二者等价(Authorization: Bearer <token>)
请求参数
Path 参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| projectKey | string | 是 | 项目主键 project_key(大小写不敏感) |
Query 参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| limit | integer | 否 | 分页大小 |
| offset | integer | 否 | 分页偏移 |
| start_time | integer | 否 | Unix 时间戳(秒) |
| end_time | integer | 否 | Unix 时间戳(秒) |
| level | integer | 否 | 0=debug, 1=info, 2=warn, 3=error |
| platform | windows | linux | macos | ios | android | web | others | 否 | 按平台筛选列表内容(不是客户端平台声明,与请求统计无关)。 对版本与公告这类有发布范围的资源,未限定平台的记录对任何平台都可见。 |
| search | string | 否 | 关键字,不区分大小写地匹配 content、ip、city、country_name、region_name 与 platform_version;device_info / custom_data 为 JSON 列,不参与匹配。 |
| include_hidden | boolean | 否 | 是否连已隐藏的日志一起返回。 |
Header 参数
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| Authorization | string | 是 | Bearer <管理员 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
