简体   繁体   中英

Stackdriver parses application logs from GKE as textpayload instead of jsonpayload

Can anyone suggest how to make stackdriver parse logs to json payload. Logs in stackdriver from application running in GKE are considered as textpayload, even if they are in json format. What are the points parser consider to mark log as textpayload or json payload?

Example in the below image the log message from application is in json with severity=error . Still, it is considered a text payload. Also, severity is marked as INFO even if error message and error severity.

So how to update my logs so that they are treated as jsonpayload instead of a 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

Google Cloud Logging supports Structured Logging and has various ways to send these logs. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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