nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #54

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…

The correct answer is A. Install the Stackdriver Logging Agent and configure it to send the application logs. The requirement is to view logs in Stackdriver (Cloud Logging) without modifying the application code. The Stackdriver Logging Agent (now Ops Agent) is a daemon that runs on the Compute Engine VM and can be configured to tail specific log files on disk and forward their…

Implementing Logging and Monitoring Solutions

Question

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?

Options

  • AInstall the Stackdriver Logging Agent and configure it to send the application logs.
  • BUse a Stackdriver Logging Library to log directly from the application to Stackdriver Logging.
  • CProvide the log file folder path in the metadata of the instance to configure it to send the
  • DChange the application to log to /var/log so that its logs are automatically sent to Stackdriver

How the community answered

(30 responses)
  • A
    90% (27)
  • B
    3% (1)
  • D
    7% (2)

Explanation

The requirement is to view logs in Stackdriver (Cloud Logging) without modifying the application code. The Stackdriver Logging Agent (now Ops Agent) is a daemon that runs on the Compute Engine VM and can be configured to tail specific log files on disk and forward their contents to Cloud Logging. By pointing the agent at the application's log file directory (via its configuration file), you achieve full log visibility in Cloud Logging with zero code changes. Option B (Stackdriver Logging Library) requires modifying the application to explicitly call logging APIs, violating the constraint. Option C (providing a log folder path in instance metadata) is not a valid or supported mechanism for configuring log ingestion. Option D (changing the app to log to /var/log) also requires changing the application code, violating the constraint.

Topics

#Cloud Logging#Compute Engine#Logging Agent#Log Collection

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice