SAP-C02 Design for New Solutions Practice Question
A company is designing a new application that will run on Amazon ECS with Fargate. The application needs to output logs to CloudWatch Logs. Which configuration should be used to send logs from the container to CloudWatch?
⚠ Common exam trap
The trap here is that candidates often over-engineer the solution by thinking a separate agent or sidecar is required for log shipping, when in fact the awslogs log driver is the simplest and most efficient native integration for ECS with Fargate.
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
✓
Use the awslogs log driver in the task definition and specify the log group.
The awslogs log driver is the native, built-in mechanism for Amazon ECS tasks using the Fargate launch type to send container logs directly to CloudWatch Logs. By specifying the 'awslogs' log driver in the task definition and providing the log group name, ECS automatically streams stdout and stderr from the container to the specified CloudWatch log group without requiring any additional agents or infrastructure.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Use the awslogs log driver in the task definition and specify the log group.
Why this is correct
The awslogs log driver is the native integration for ECS and Fargate to send logs to CloudWatch.
- ✗
Install and configure the CloudWatch agent in the container image.
Why it's wrong here
Installing the CloudWatch agent inside the container image is unnecessary because the awslogs log driver, configured in the ECS task definition, natively streams container stdout and stderr to CloudWatch Logs without any in-container agent. This option is tempting because the CloudWatch agent is the standard method for collecting logs from EC2 instances or on-premises servers, where no built-in log driver exists; it would be correct for a non-Fargate host-based workload requiring custom metric or log-file collection.
- ✗
Output logs to stdout/stderr and use a Lambda function to push them.
Why it's wrong here
This adds unnecessary complexity; the awslogs driver captures stdout/stderr automatically.
- ✗
Configure a sidecar container running the CloudWatch agent.
Why it's wrong here
A sidecar is not necessary; the awslogs driver works directly.
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.