简体   繁体   English

Stackdriver 将来自 GKE 的应用程序日志解析为 textpayload 而不是 jsonpayload

[英]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.

相关问题 Spring启动stackdriver日志记录是textPayload而不是jsonPayload - Spring boot stackdriver logging is textPayload and not jsonPayload Stackdriver日志未显示在GKE中 - Stackdriver logs not showing up in GKE 如何在 GKE 上通过 stackdriver 查看容器日志 - How to view container logs via stackdriver on GKE 使用 Fluentd 进行日志记录 - 为什么 json 日志文件的输出显示为 textpayload(而不是 jsonpayload)? - Logging with Fluentd - why is the output of json log file appearing as textpayload (not jsonpayload)? GKE - Stackdriver - GKE - Stackdriver 有没有一种方法可以将应用程序日志流式传输到另一个Stackdriver项目? - Is there a way to stream application logs to a different Stackdriver project? 如何查看日志是来自在 Jenkins Kubernetes 容器上运行的 Java 应用程序的 Stackdriver - How to see logs is Stackdriver from Java application run on Jenkins Kubernetes container 从 Web 应用程序登录到 Stackdriver - Logging to Stackdriver from a web application 如何使用带有 jsonPayload 的 StructuredLogHandler 将日志发送到 GCP? - How to send logs to GCP using StructuredLogHandler with jsonPayload? 阻止用户在Stackdriver Log查看器中下载日志 - Prevent users from downloading logs in Stackdriver Log viewer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM