QuestionQ192

Integrating applications with Google Cloud services

You have an application running on Google Kubernetes Engine (GKE). The application currently uses a logging library and writes to standard output. You need to export its logs to Cloud Logging, and the logs must include metadata for every request. You want to use the simplest approach. What should you do?

  • A Change your application’s logging library to the Cloud Logging library, and configure your application to export logs to Cloud Logging.
  • B Update your application to output logs in JSON format, and add the necessary metadata to the JSON.
  • C Update your application to output logs in CSV format, and add the necessary metadata to the CSV.
  • D Install the Fluent Bit agent on each of your GKE nodes, and have the agent export all logs from /var/log.
Explanation

GKE’s managed logging agent automatically collects container output written to standard output and sends it to Cloud Logging. When that output is a serialized JSON object, GKE stores it as a structured log entry, allowing request metadata to be included as queryable JSON fields.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!