DVA-C02 Development with AWS Services Practice Question
A company runs a containerized application on Amazon ECS with Fargate. The application writes logs to stdout. The operations team wants to send these logs to a centralized log management tool that requires logs in JSON format. What is the BEST way to achieve this without modifying application code?
⚠ Common exam trap
Many exam-takers assume the awslogs log driver can format logs as JSON (it cannot) or that installing an agent on Fargate containers is possible (it is not), leading them to overlook FireLens as the only serverless-compatible, code-free option for log transformation and routing.
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 FireLens log driver to route logs to Fluent Bit and then to the tool
FireLens is an ECS log driver that integrates with Fluent Bit or Fluentd to route, filter, and transform container logs without modifying application code. By using FireLens with Fluent Bit, you can configure a JSON parser to convert stdout logs into JSON format before forwarding them to the centralized log management tool, meeting the requirement exactly.
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 FireLens log driver to route logs to Fluent Bit and then to the tool
Why this is correct
The FireLens log driver is the appropriate solution for routing and transforming container logs on Amazon ECS, especially when running on AWS Fargate. It integrates seamlessly with Fluent Bit or Fluentd as a sidecar container, enabling powerful log processing capabilities like parsing unstructured logs into JSON, filtering, and routing them to various destinations beyond CloudWatch Logs. This approach centralizes log management without requiring modifications to the application code itself, aligning with best practices for containerized environments.
- ✗
Use the awslogs log driver and configure a JSON output format
Why it's wrong here
The awslogs log driver is designed primarily to send container logs directly to Amazon CloudWatch Logs without significant transformation capabilities. While it effectively forwards logs, it lacks the built-in functionality to parse unstructured log lines and convert them into a structured JSON output format *before* ingestion. Therefore, relying solely on the awslogs driver would not achieve the desired JSON output transformation without additional processing steps downstream in CloudWatch Logs, which is not what the driver itself provides.
- ✗
Install the CloudWatch Logs agent on the container
Why it's wrong here
Installing the CloudWatch Logs agent directly on the container is not a viable solution, especially if the application is running on AWS Fargate. Fargate is a serverless compute engine for containers, meaning users do not have access to the underlying host EC2 instances to install or manage agents. Even in an EC2 launch type, installing a host-level agent *inside* every application container is generally an anti-pattern, as it couples logging infrastructure with the application and increases container image size and complexity.
- ✗
Modify the application to output logs in JSON format
Why it's wrong here
Modifying the application code to output logs directly in JSON format, while a good practice for structured logging, is explicitly not desired in this scenario. The question implies a requirement to achieve log transformation without altering the existing application code. This option would necessitate development effort, testing, and redeployment of the application, which goes against the constraint of finding a solution that works externally to the application's codebase.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DVA-C02 question from scratch — 724 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 DVA-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 DVA-C02 exam.