[英]Stackdriver parses application logs from GKE as textpayload instead of jsonpayload
Can anyone suggest how to make stackdriver parse logs to json payload.任何人都可以建议如何使堆栈驱动程序将日志解析为 json 有效负载。 Logs in stackdriver from application running in GKE are considered as textpayload, even if they are in json format.
来自在 GKE 中运行的应用程序在 stackdriver 中的日志被视为 textpayload,即使它们是 json 格式。 What are the points parser consider to mark log as textpayload or json payload?
解析器考虑将日志标记为 textpayload 或 json 有效负载的点是什么?
Example in the below image the log message from application is in json with severity=error
.下图中的示例来自应用程序的日志消息在 json 中,
severity=error
。 Still, it is considered a text payload.尽管如此,它仍被视为文本有效负载。 Also, severity is marked as INFO even if error message and error severity.
此外,即使错误消息和错误严重性,严重性也被标记为 INFO。
So how to update my logs so that they are treated as jsonpayload instead of a textpayload.那么如何更新我的日志,以便将它们视为 jsonpayload 而不是 textpayload。
First check that your GKE clusters are using the default cluster logging and monitoring setup as described here: https://cloud.google.com/stackdriver/docs/solutions/gke/managing-logs首先检查您的 GKE 集群是否使用默认集群日志记录和监控设置,如下所述: https ://cloud.google.com/stackdriver/docs/solutions/gke/managing-logs
Google Cloud Logging supports Structured Logging and has various ways to send these logs. Google Cloud Logging 支持结构化日志记录,并有多种方式来发送这些日志。 For recognizing JSON logs collected from stdout, ensure that it follows the schema found in the documentation: https://cloud.google.com/logging/docs/structured-logging
要识别从标准输出收集的 JSON 日志,请确保它遵循文档中的架构: https ://cloud.google.com/logging/docs/structured-logging
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.