Google Cloud Professional Cloud Developer — Question 95
You have a mixture of packaged and internally developed applications hosted on a Compute Engine instance that is running Linux. These applications write log records as text in local files. You want the logs to be written to Cloud Logging. What should you do?
Answer options
- A. Pipe the content of the files to the Linux Syslog daemon.
- B. Install a Google version of fluentd on the Compute Engine instance.
- C. Install a Google version of collectd on the Compute Engine instance.
- D. Using cron, schedule a job to copy the log files to Cloud Storage once a day.
Correct answer: B
Explanation
The correct answer is B, as installing a Google version of fluentd allows for seamless integration with Cloud Logging, enabling real-time log transport. Option A is incorrect because while Syslog can manage logs, it does not directly send them to Cloud Logging. Option C is wrong since collectd is mainly for collecting metrics, not logs. Option D is inefficient as it involves manual daily transfers instead of real-time logging.