我正在尝试跟踪我在 Bluemix 中部署的应用程序的日志。每次我通过 bx app push [app-name]
部署时,都会收到以下错误(但部署仍然成功):
Warning: error tailing logs
Loggregator endpoint missing from config file
尝试跟踪日志会产生:
$ bx app logs [app-name]
Invoking 'cf logs [app-name]'...
FAILED
Loggregator endpoint missing from config file
这是一个 Node.js 应用程序,我需要在 package.json
中定义一些内容吗?我在 documentation 中读到的所有内容看起来这应该自动工作:
The Loggregator automatically picks up STDOUT and STDERR data.
版本信息:
$ bx -v
bx version 0.5.4+ae22935-2017-05-18T06:24:28+00:00
最佳答案
我听说 Bluemix bx
CLI 捆绑了较旧的 cf CLI 版本。
cf CLI 6.24.0 停止支持已弃用的“loggregator”端点,转而支持多普勒端点。
因此,当您使用 cf CLI >=6.24.0 执行 cf api
或 cf login
时,loggregator 端点将不会添加到配置文件中,从而导致 bx
无法收集日志。这会导致您在 bx app push
、bx app start
(暂存时)和 bx app resage
以及 中看到警告>bx 应用程序日志
失败。
更新 bx
之前的解决方法是按照 https://stackoverflow.com/a/44639332/1227328 中建议的步骤进行操作。 ,或者只是为了不将 bx
与任何 cf CLI 版本 >=6.24.0 混合使用,并再次设置 API 端点以使(较旧的)CLI 保存“loggregator”端点在其本地配置文件中。
关于node.js - 配置文件中缺少 Bluemix CF App Loggregator 端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44653659/