我正在尝试使用新的Heroku api通过curl传输我的应用程序的日志:这是文档中所说的内容(https://devcenter.heroku.com/articles/platform-api-reference#app)
Streaming is performed by doing an HTTP GET method on the provided logplex url and retrieving log lines utilizing chunked encoding.
Run Code Online (Sandbox Code Playgroud)
因此,首先我检索logplex网址:
curl -X POST https://api.heroku.com/apps/my-app/log-sessions \
-H "Accept: application/vnd.heroku+json; version=3" \
-H "Authorization:XXX" -v
Run Code Online (Sandbox Code Playgroud)
然后,我在响应中得到如下信息:
"logplex_url":"https://logplex.heroku.com/sessions/abcdef-079b-4264-a83c-031feb31bfc2?srv=132456798"
Run Code Online (Sandbox Code Playgroud)
所以我又打了个电话:
curl -X GET "https://logplex.heroku.com/sessions/abcdef-8a7e-442f-a164-4c64e845b62d?srv=123456798" -H "Transfer-Encoding: chunked"
Run Code Online (Sandbox Code Playgroud)
我一直保持联系,但是什么都没有...
如果未指定Transfer-Encoding标头,则会获取日志,但连接会关闭。
是否真的可以像参考中指定的那样流式传输日志?