Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Google Cloud Certified Professional Cloud Developer · Google Cloud
Select 2 answers.
This question asks for 2 answers, but our data marks only 1. Compare with the community discussion below for the full answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
To standardize log data and maximize its utility on Google Kubernetes Engine (GKE) with the fewest number of steps, the two best practices are: C. Write log output to standard output (stdout) as single-line JSON to be ingested into Cloud Logging as structured logs. D. Mandate the use of the Logging API in the application code to write structured logs to Cloud Logging. Why these are the recommended practices Standardizing logs in a microservices environment requires moving from plain text (which is hard to search) to structured data.
C. Single-line JSON to Cloud Logging: This is the most straightforward and efficient way to standardize logs. By writing logs as single-line JSON, you ensure consistent formatting and make it easy for Cloud Logging to parse and analyze the data. Cloud Logging automatically handles ingestion and storage. D. Logging API for Structured Logs: Using the Logging API directly allows for more control over log formatting and metadata. You can include specific labels, severity levels, and other information to make your logs more informative. This approach also ensures that logs are written directly to Cloud Logging, eliminating the need for additional processing steps.
Why other options are less ideal: A. Aggregated Exports to BigQuery: While BigQuery is excellent for analytics, this approach requires additional steps to configure and manage exports. It's not the most efficient way to standardize logs initially. B. Aggregated Exports to Cloud Storage: Similar to option A, this adds complexity and requires additional processing to analyze the data in Cloud Storage. E. Pub/Sub and Dataflow: This is a more complex solution that involves multiple services and requires significant development effort. It's overkill for simply standardizing logs.