Google Cloud Professional Cloud Developer — Question 24

You are deploying your application to a Compute Engine virtual machine instance. Your application is configured to write its log files to disk. You want to view the logs in Stackdriver Logging without changing the application code.
What should you do?

Answer options

Correct answer: A

Explanation

The correct answer is A because installing the Stackdriver Logging Agent allows for log collection without changing the application code. Option B is incorrect as it involves modifying the application. Option C does not provide a standalone solution since it requires additional setup without the agent. Option D also necessitates altering the application, which is not desired in this scenario.