Skip to main content

Query Streaming Task Logs

更新时间:2025-05-08 16:32:25
View streaming task logs. (This interface requires HTTP/2; otherwise, stuttering or reconnection issues may occur).
GET
https://api.alayanew.com/api/serverless-train/v1/task/{id}/logsStream
Authorizations
AuthorizationsStringHeaderRequired

用户可通过已获取Open API Key做验证,例如:plain Credential=[YOUR_AK],Signature=[YOUR_SK]。

Path Parameters
idStringRequired

Task ID.

Query Parameters
workerInt

The index of the worker, starting from 0.

fromInt

The starting line number, default is 1.

tailInt

The number of lines to show from the end, default is 1000.

curl --http2 -X GET 'https://api.alayanew.com/api/serverless-train/v1/task/506927a1-1883-4413-abad-0de1ff309023/logsStream?tail=1000' 
             -H 'Authorization: plain Credential=YOUR_AK,Signature=YOUR_SK'
2025-02-25 19:22:51.064 [ERROR] 117447
2025-02-25 19:22:52.064 [ERROR] 117448
2025-02-25 19:22:53.064 [ERROR] 117449
2025-02-25 19:22:54.064 [ERROR] 117450
2025-02-25 19:22:55.064 [ERROR] 117451
2025-02-25 19:22:56.065 [ERROR] 117452
2025-02-25 19:22:57.070 [ERROR] 117453
2025-02-25 19:22:58.066 [ERROR] 117454
2025-02-25 19:22:59.066 [ERROR] 117455
2025-02-25 19:23:00.067 [ERROR] 117456
2025-02-25 19:23:01.067 [ERROR] 117457
tip

如果fromtail都没有指定,日志将从第一行开始打印。