/api/trace
返回跟踪文件的一个片段。
为了帮助您更灵活地定义跟踪片段的大小和位置,您可以使用以下查询参数进行设置:
- count:从跟踪文件中返回最后指定数量的字节
- from 和可选的 to:从指定的起始偏移量开始,到结束偏移量(或文件末尾)为止的跟踪文本
每次请求都会以 JSON 格式返回,其中包含以下信息:
- trace:即您所请求的跟踪内容
- from:片段在文件中的起始偏移量
- to:片段在文件中的结束偏移量
当 REST 服务器启动并监听 8083 端口时,您可以通过发送 HTTP 请求来获取跟踪文件的最后 100 个字节。
GET http://localhost:8083/api/trace?count=100
返回的输出结果将如下所示:
{
"trace":
"\/mcobject\/eXtremeDB_8.0\/SmartEDB\/target\/xsql\/mcoxsql\/mcoxsql.cpp:2916-mcorest started at port 8083\n",
"from": 5051,
"to": 5151
}
以下 HTTP 请求将返回从偏移量 5051 到跟踪文件末尾的字节:
GET http://localhost:8083/api/trace?from=5051
返回的输出结果将如下所示:
{
"trace":
"\/mcobject\/eXtremeDB_8.0\/SmartEDB\/target\/xsql\/mcoxsql\/mcoxsql.cpp:2916-mcorest started at port 8083\n",
"from": 5051,
"to": 5151
}
以下 HTTP 请求将返回跟踪文件中从偏移量 5051 到偏移量 5100 的字节:
GET http://localhost:8083/api/trace?from=5051&to=5100
返回的输出结果将如下所示:
{"\/mcobject\/eXtremeDB_8.0\/SmartEDB\/target\/xsql\/mco",
,
"from": 5051,
"to": 5100
}