
Answer-first summary for fast verification
Answer: Modify the application to use Cloud Logging software development kit (SDK), and send log entries with a jsonPayload field.
To convert unstructured logs to JSON-based structured logs in a Cloud Run application, the most effective approach is to modify the application itself to use the Cloud Logging SDK. This SDK allows the application to send log entries directly with a jsonPayload field, which inherently structures the logs in JSON format. This method is direct and leverages Google Cloud's native tools for optimal integration and performance. Option A is correct because it addresses the requirement at the application level, ensuring that logs are structured as they are generated. Options B, C, and D involve additional components or configurations that may introduce complexity or inefficiency compared to directly using the Cloud Logging SDK.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
How can you transform unstructured text logs from a Cloud Run application into JSON-based structured logs in Cloud Logging?
A
Modify the application to use Cloud Logging software development kit (SDK), and send log entries with a jsonPayload field.
B
Install a Fluent Bit sidecar container, and use a JSON parser.
C
Install the log agent in the Cloud Run container image, and use the log agent to forward logs to Cloud Logging.
D
Configure the log agent to convert log text payload to JSON payload.
No comments yet.