How can you view application logs in Stackdriver Logging without changing the code of your application?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the Google Cloud Professional Cloud Developer Test. Benefit from mock assessments featuring flashcards and multiple-choice format, each furnished with hints and detailed explanations. Excel in your exam with confidence!

The correct choice is to install the Stackdriver Logging Agent. This agent is designed to facilitate the collection, processing, and transportation of logs from your application to Stackdriver, which is now part of Google Cloud's operations suite. By installing the agent on your virtual machine or managed instance groups, you can automatically collect logs from various sources without needing to modify your application code.

Once the agent is in place, it can be configured to discover log files in specified directories and format them appropriately for Stackdriver Logging. This minimizes the need for development intervention, ensures logs are consistently captured, and allows you to centralize log management without risking application disruptions or requiring code updates.

The other options, such as using a Stackdriver Logging library, typically involve changing the application code to integrate logging functionality specifically designed for Stackdriver, which is not aligned with the requirement of viewing logs without modifying the application. Providing the log file folder path in metadata and changing the application to log to specific directories also imply some degree of alteration to the application structure or configuration, which the question seeks to avoid. Installing the Stackdriver Logging Agent stands out as the most efficient and non-intrusive method for viewing application logs in this context.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy