SAP-C02 Continuous Improvement for Existing Solutions Practice Question
A company runs a production web application on EC2 instances in an Auto Scaling group behind an ALB. The application logs are stored on an EBS volume attached to each instance. The operations team notices that the logs are not being sent to a central location. What is the MOST efficient way to centralize log collection with minimal code changes?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Install the CloudWatch Logs agent on each EC2 instance and configure it to stream the log files to CloudWatch Logs.
Installing the CloudWatch Logs agent on each EC2 instance and configuring it to stream log files to CloudWatch Logs centralizes log collection without requiring any changes to the application code. Option A is incorrect because modifying the application to use the AWS SDK to send logs via PutLogEvents API would require code changes. Option B is incorrect because while Amazon Kinesis Agent could be used to send logs to Kinesis Data Firehose and then to S3, this approach is more complex and not the most efficient for simple log centralization from EC2 instances; the CloudWatch Logs agent is purpose-built for this task. Option C is incorrect because setting up an S3 bucket with a lifecycle policy to transition logs to Glacier does not collect logs; it only manages log storage after they are already in S3, and logs would need to be sent to S3 first.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Modify the application to use the AWS SDK to send logs to CloudWatch Logs via PutLogEvents API.
Why it's wrong here
Requires modifying application code to use AWS SDK, which is not minimal.
- ✗
Use Amazon Kinesis Agent to send logs to Kinesis Data Firehose and then to S3.
Why it's wrong here
Kinesis Agent adds complexity and is not the most efficient for direct EC2 log streaming.
- ✗
Set up an S3 bucket with a lifecycle policy to transition logs to Glacier.
Why it's wrong here
An S3 lifecycle policy alone does not collect logs; logs must first be sent to S3.
- ✓
Install the CloudWatch Logs agent on each EC2 instance and configure it to stream the log files to CloudWatch Logs.
Why this is correct
CloudWatch Logs agent streams logs directly from EC2 to CloudWatch without code changes.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every SAP-C02 question from scratch — 1,660 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SAP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SAP-C02 exam.