nerdexam
Amazon

SAP-C02 · Question #526

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…

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…

Submitted by kevin_r· Mar 6, 2026Continuous Improvement for Existing Solutions

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.

How the community answered

(49 responses)
  • A
    2% (1)
  • B
    90% (44)
  • C
    2% (1)
  • D
    6% (3)

Why each option

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.

AEnable access logs for the ALB. Store the logs in an Amazon S3 bucket.

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.

BConfigure the EC2 instances to publish logs to Amazon CloudWatch Logs by using the unifiedCorrect

Configuring EC2 instances to publish application logs to Amazon CloudWatch Logs using the unified CloudWatch agent ensures logs are collected and persisted centrally, making them available for analysis even after instances are terminated during scale-in events.

CModify the Auto Scaling group to use a step scaling policy.

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.

DInstrument the application with AWS X-Ray tracing.

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

Source: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html

Community Discussion

No community discussion yet for this question.

Full SAP-C02 Practice