hardMultiple Choice
Google ACE Practice Question: An application running on Compute Engine writes…
An application running on Compute Engine writes logs to a local file. The operations team wants to centralize these logs in Cloud Logging with minimal code changes. What is the recommended approach?
⚠ Common exam trap
A common pitfall is that candidates may choose the client library option, thinking it is the 'proper' way to integrate with Google Cloud services, but this requires code changes. The agent-based approach requires no code changes and is the recommended method for centralizing logs with minimal effort.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Install and configure the Cloud Logging agent on the instance.
The Cloud Logging agent (formerly known as the Stackdriver Logging agent) is the recommended approach because it automatically tails the local log file, parses common log formats, and streams entries to Cloud Logging using the fluentd-based agent. This requires no application code changes and minimal configuration, meeting the requirement of centralizing logs with minimal code changes.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Cloud Scheduler to tail the log file and send entries to Logging.
Why it's wrong here
Cloud Scheduler cannot tail a file or forward entries; it only triggers HTTP or Pub/Sub targets on a schedule. It is tempting because it is a serverless scheduling service, and would be correct for invoking a job or endpoint at fixed intervals, not for streaming log content.
- ✓
Install and configure the Cloud Logging agent on the instance.
Why this is correct
The Cloud Logging agent (fluentd-based) tails specified local files and forwards entries to Cloud Logging, so existing file-writing code stays unchanged. Only agent installation and a file-path configuration are needed, satisfying the minimal-code-change constraint without refactoring the application.
- ✗
Set up a scheduled cron job to upload the log file via gcloud logging write.
Why it's wrong here
A cron job writing via gcloud logging write introduces scheduling lag, requires credential handling and duplicates entries rather than streaming them. It is tempting because scheduled batch uploads suit periodic archival of closed files, not continuous centralisation of an actively written log.
- ✗
Modify the application to use the Cloud Logging client library.
Why it's wrong here
Adding the Cloud Logging client library requires code changes, contradicting the minimal-code requirement; the Ops Agent streams the file unmodified. It is tempting because the client library gives structured, low-latency logging and is the right choice when the application can be modified directly.
Go deeper
Related to this question
Learn chapter
Cloud Run and App Engine
Key term
Compute Engine
Compute Engine is Google Cloud's Infrastructure-as-a-Service (IaaS) offering that lets you create and run virtual machines on Google's infrastructure.
Key term
Cloud logging
Cloud logging is the practice of collecting, storing, and analyzing log data generated by cloud-based resources and applications to monitor performance, troubleshoot issues, and maintain security.
About these practice questions
This ACE question is part of Courseiva's 775-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.