简体   繁体   English

切换流利的Stackdriver日志API v2

[英]Switch fluentd to Stackdriver logging API v2

We've got a Google Compute Engine webserver running Ubuntu on Google Cloud Platform, which sends logs to the Stackdriver Logging API "v1beta" 我们在Google云平台上运行了一个运行Ubuntu的Google Compute Engine网络服务器,它将日志发送到Stackdriver Logging API“v1beta”

We received emails from Google Cloud Platform about the Stackdriver Logging API v1beta3 deprecation, alerting us that our "project" is still accessing the v1 API, and advising us to switch to the v2 API. 我们收到了来自Google Cloud Platform的关于Stackdriver Logging API v1beta3弃用的电子邮件,提醒我们我们的“项目”仍在访问v1 API,并建议我们切换到v2 API。 The email advised upgrading the Stackdriver Logging Agent (fluentd), which I have done. 电子邮件建议升级Stackdriver日志代理(流利),我已经完成了。

If I try to send a log item from the command line on that server: 如果我尝试从该服务器上的命令行发送日志项:

logger "Hello world!"

It still appears in the Stackdriver Log in the v1 API format (with metadata.projectId , metaData.serviceName , etc.) 它仍然以v1 API格式显示在Stackdriver Log中(包含metadata.projectIdmetaData.serviceName等)

How can I configure fluentd to hit the v2 API instead of the deprecated v1 API? 如何配置fluentd来命中v2 API而不是弃用的v1 API? I have to update all the logging integration in the apps on this server, but I can't see where or how to get the logging agent to use the new API. 我必须更新此服务器上的应用程序中的所有日志记录集成,但我看不到在何处或如何让日志记录代理使用新API。

Are you viewing the logs in the Stackdriver UI? 您是否在Stackdriver UI中查看日志? Because the migration page says that Log Viewer currently displays everything in v1 format even if it's v2. 因为迁移页面显示日志查看器当前以v1格式显示所有内容,即使它是v2。

The Logs Viewer presently uses only the v1 API. Logs Viewer目前仅使用v1 API。 In the future, there will be support for the v2 API, but for now the limitation might be a hindrance to your migration... 将来,将会支持v2 API,但目前这种限制可能会妨碍您的迁移......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM