SAP-C02 · Question #526
SAP-C02 Question #526: Real Exam Question with Answer & Explanation
The correct answer is B: Configure the EC2 instances to publish logs to Amazon CloudWatch Logs by using the unified. To ensure application logs are viewable after EC2 instances in an Auto Scaling group terminate during a scale-in event, the instances should be configured to publish their application logs to Amazon CloudWatch Logs using the unified CloudWatch agent for centralized and persistent
Question
A company has an application that is deployed on Amazon EC2 instances behind an Application Load Balancer (ALB). The instances are part of an Auto Scaling group. The application has unpredictable workloads and frequently scales out and in. The company's development team wants to analyze application logs to find ways to improve the application's performance. However, the logs are no longer available after instances scale in. Which solution will give the development team the ability to view the application logs after a scale-in event?
Options
- AEnable access logs for the ALB. Store the logs in an Amazon S3 bucket.
- BConfigure the EC2 instances to publish logs to Amazon CloudWatch Logs by using the unified
- CModify the Auto Scaling group to use a step scaling policy.
- DInstrument the application with AWS X-Ray tracing.
Explanation
To ensure application logs are viewable after EC2 instances in an Auto Scaling group terminate during a scale-in event, the instances should be configured to publish their application logs to Amazon CloudWatch Logs using the unified CloudWatch agent for centralized and persistent storage.
Common mistakes.
- A. ALB access logs capture information about requests made to the load balancer, not the application-specific logs generated by the application running on the EC2 instances.
- C. Modifying an Auto Scaling group to use a step scaling policy controls how capacity is adjusted but does not address the collection or persistence of application logs.
- D. AWS X-Ray provides distributed tracing for performance analysis, offering insights into request flow and bottlenecks, but it does not collect or store raw application logs.
Concept tested. Centralized Logging, CloudWatch Logs, Auto Scaling
Reference. https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html
Community Discussion
No community discussion yet for this question.