You have deployed an application on a single Compute Engine instance. The application writes logs to disk. Users start reporting errors with the application. You want to diagnose the problem. What should you do?
A.
Navigate to Cloud Logging and view the application logs.
B.
Connect to the instance's serial console and read the application logs.
C.
Configure a Health Check on the instance and set a Low Healthy Threshold value.
D.
Install and configure the Cloud Logging Agent and view the logs from Cloud Logging.
Continuation of reasoning.
If Problem statement is not having this statement "The application writes logs to disk", then we might assume that application is writing logs on Cloud Logging with google-fluentd agent API library. However, problem statement is clearly mentioned that logs are writing down on disk, we need agent installed on GCE to fetch those logs from disk to Cloud Logging. If that is not desirable, then option B is left
(Correction) Answer is A after rethinking and doing some research by focusing words "App Engine", which has by default enabled Request Logs which has App logs on each request and those logs are enabled for Cloud Logging ..
https://cloud.google.com/appengine/docs/standard/python/logs#request_logs_vs_application_logs
Cloud logging without agent only works for App engine as you stated . but the question is about the compute engine which has to be equipped first with Logging Agent in order to write logs into Cloud Logging. so based your assumption the correct answer is "D"
Correct Answer is (D):
In its default configuration, the Logging agent streams logs from common third-party applications and system software to Logging; review the list of default logs. You can configure the agent to stream additional logs; go to Configuring the Logging agent for details on agent configuration and operation.
It is a best practice to run the Logging agent on all your VM instances. The agent runs under both Linux and Windows. To install the Logging agent, go to Installing the agent.
https://cloud.google.com/logging/docs/agent
Do you mean the logging agent is installed by default? It depends on the OS you decide. For example, it is installed in Ubuntu but not on RedHat or Windows. Besides installing of the agent is not enough. You have to configure and let the agent know where your application is writing the logs on the disk so that it can monitor and stream the log to cloud monitoring. D is the correct answer
CORRECTION.
Correct Answer is (A):
Activity logging is enabled by default for all Compute Engine projects.
You can see your project's activity logs through the Logs Viewer in the Google Cloud Console:
In the Cloud Console, go to the Logging page.
Go to the Logging page
When in the Logs Viewer, select and filter your resource type from the first drop-down list.
From the All logs drop-down list, select compute.googleapis.com/activity_log to see Compute Engine activity logs.
https://cloud.google.com/compute/docs/logging/activity-logs#viewing_logs
Besides:
Activity logs are provided as part of the Cloud Logging service. For more information about Logging in general, read the Cloud Logging documentation.
https://cloud.google.com/compute/docs/logging/activity-logs
Activity Logs do not include 2rd party application logs. Activity logs are more related to operations and changes in the infrastructure. This question is tricky, I think it's either D or B, because if it's only an application on a single instance, you can connect to the instance and read the application logs directly and you save the cost of logging agent.
Maybe I was assuming serial console is the same than system console, technically I guess they're not the same, hence I guess D will be my chosen answer.
Additional information about VM Image for AWS EC2:
The Logging agent streams logs from your VM instances and from selected third-party software packages to Cloud Logging. It is a best practice to run the Logging agent on all your VM instances.
The VM images for Compute Engine and Amazon Elastic Compute Cloud (EC2) don't include the Logging agent, so you must complete these steps to install it on those instances. The agent runs under both Linux and Windows.
If your VMs are running in Google Kubernetes Engine or App Engine, the agent is already included in the VM image, so you can skip this page.
Questions are tricky but let's reiterate this question. Hints are that there's an error in the application and that log are written to disk. Which means, it continues to write to the disk where the instance is functional. Therefore, correct method should be to install the agent and then analyze further on the output of the logs. So, answer is D
This question is from 2020, in that year there was an Logging agent, now called Legacy Logging agent. It is the Ops Agent of nowadays.
With that agent, yes, you can configurate it to send personalized logs to GCP. But I think this question says that the app is already malfunctioning, so the logs of that are in the disk. For me it is B.
for me is b, but there is a recent question 2023: 231 in examtopics.
And D answer is:
"D. Install and configure the Ops agent and view the logs from Cloud Logging."
So to pass the exam, here select D. But for me, the question is confused. Because they want to see past logs, so install ops agent will not show past logs of application.
B will be correct if we talk about VM issues (access to an instance's serial console to debug boot and networking issues, troubleshoot malfunctioning instances, interact with the GRand Unified Bootloader (GRUB), and perform other troubleshooting tasks.)
Selected Answer: D
When and why do we need it? Serial console access is useful in the following situations:
When the VM is not booting: You can use serial console access to see the boot messages and identify the problem.
When the VM is hung: You can use serial console access to see what the VM is doing and try to unfreeze it.
When you need to access the VM’s BIOS or UEFI: You can use serial console access to access the VM’s BIOS or UEFI, which can be useful for changing settings or troubleshooting problems.
Resolving issues with the VM’s operating system.
Its B, App logs are not provided by default and requires to have an agent installed.
https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-using-serial-console
The line "application writes logs to disk" is crucial. It means logs are not available in cloud logging to yet. Hence we need to install the logging agent to send the logs to Cloud Logging.
Answer is D
yes you are wright, so you need to see de past logs, so it is B. For the future, after installation of Cloud Logging (now Ops Agent) we will be able to see them in Cloud Logging.
Rethinking it again:
The serial console provides a text-based interface that allows you to view the boot-up process and access the login prompt of the instance. From there, you can troubleshoot issues, change configuration settings or perform other administrative tasks.
The serial console is a useful tool for troubleshooting issues with Compute Engine instances, especially in situations where network connectivity is not available or where the operating system is not functioning properly.
To configure logging for your GCP VMs, you need to install the Cloud Logging agent on each of your instances. The Cloud Logging agent collects log data from the instance and sends it to the Cloud Logging API, where it is stored and can be viewed in the Cloud Logging console.
We need to diagnose it quickly - simply login to instance and check logs. When there's application outage, it's not good idea to install cloud agent and wait until logs appear in the Cloud Logging
Serial port is not used for application debugging generally. It is mainly used for boot issues, network connectivity issues, accessing VM not possible by other menthods
logging agent is deprecated,i find this in documentation
https://cloud.google.com/logging/docs/agent/logging/installation
" While this agent is still supported, we recommend that you use the Ops Agent for new Google Cloud workloads and eventually transition your existing Compute Engine VMs to use the new agent. The Ops Agent, which combines the collection of metrics and logging into a single agent, is the eventual replacement for the existing agents."
so the question points to the logging agent not to the ops agent so i think correct answer is A
D
Installing the Cloud Logging agent on individual VMs
If your VMs are running in Google Kubernetes Engine or App Engine, the agent is already included in the VM image, so you can skip this page.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
hiteshrup
Highly Voted 4 years, 2 months agoashrafh
3 years, 3 months agohiteshrup
4 years, 2 months agohiteshrup
4 years, 2 months agorezavage
4 years, 2 months agoEshkrkrkr
4 years agocuban123
4 years agoESP_SAP
Highly Voted 4 years, 3 months agosapguru
4 years, 3 months agocsrazdan
2 years, 4 months agoESP_SAP
4 years, 3 months agobabusartop17
3 years, 3 months agoDamonSalvatore
3 years, 2 months agomexblood1
4 years, 2 months agomexblood1
4 years, 2 months agoESP_SAP
4 years, 3 months agomagistrum
3 years, 11 months agoC0D3LK
Most Recent 2 months, 3 weeks agoccpmad
6 months agoccpmad
6 months agomoumou
9 months, 1 week agoSHAAHIBHUSHANAWS
11 months, 1 week agoogerber
11 months, 3 weeks agoCaptain1212
1 year, 2 months agoPraxii
1 year, 7 months agoccpmad
6 months agoMahAli
1 year, 7 months agoMahAli
1 year, 7 months agoxaqanik
1 year, 9 months agoFeaRoX
1 year, 10 months agoeeeee123
1 year, 9 months agoalain_maza
1 year, 11 months agoromega2
1 year, 12 months agoAwesomeGCP
2 years, 1 month agoCharumathi
2 years, 1 month ago