DVA-C02 Development with AWS Services Practice Question
A developer wants to debug an AWS Lambda function by viewing real-time logs. Which AWS service should the developer use?
⚠ Common exam trap
Many exam-takers confuse AWS X-Ray's tracing capabilities with real-time log viewing, but X-Ray provides request-level traces and service maps, not the raw log output needed for debugging code execution.
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
✓
Amazon CloudWatch Logs
Amazon CloudWatch Logs is the correct service because AWS Lambda automatically streams all execution logs, including real-time output from console.log() statements and any errors, to CloudWatch Logs. The developer can use the CloudWatch Logs console or the `aws logs tail` command to view these logs in near real-time, enabling effective debugging of function behavior as it executes.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Amazon CloudWatch Logs
Why this is correct
Amazon CloudWatch Logs is the primary and automatic destination for AWS Lambda function execution logs. When a Lambda function runs, any output from `console.log` (Node.js), `print()` (Python), or similar logging statements in the function code is automatically streamed to a dedicated log group in CloudWatch Logs. Developers can then view these logs in real-time, filter them, and search for specific events or errors, making it essential for debugging application logic and understanding function behavior.
- ✗
AWS X-Ray
Why it's wrong here
AWS X-Ray is a distributed tracing service designed to help developers analyze and debug production applications by providing an end-to-end view of requests as they travel through various services. While X-Ray can show performance bottlenecks and service interactions, it does not display the granular application-level log messages generated by the Lambda function's code itself. Its purpose is tracing the flow and performance of requests, not collecting standard application output logs for debugging.
- ✗
Amazon S3
Why it's wrong here
Amazon S3 is an object storage service primarily used for storing and retrieving data, including archived logs, but it is not designed for real-time streaming or interactive viewing of live application logs. Although CloudWatch Logs can be configured to export logs to S3 for long-term archival, Lambda functions do not directly send their execution logs to S3 for immediate debugging purposes. S3 lacks the real-time search, filtering, and streaming capabilities inherent to a dedicated logging service.
- ✗
AWS CloudTrail
Why it's wrong here
AWS CloudTrail is a service that records AWS API calls made by an account, providing a history of actions taken within the AWS environment for security analysis, resource change tracking, and compliance auditing. It logs events like a Lambda function being invoked or updated, but it does not capture the application-specific output logs generated by the Lambda function's internal code during execution. CloudTrail focuses on control plane operations, not the data plane's application-level debugging output.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 724-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.