A developer built a serverless application that uses API Gateway, Lambda functions, and Route 53. During testing the developer sees errors but cannot immediately find the root cause. To search across all application logs with the least operational overhead, what should the developer do?
Choose an answer
Tap an option to check your answer.
Correct answer: Enable CloudWatch Logs for the API Gateway stages with JSON format for API requests. Use CloudWatch Logs Insights to search and analyze logs from the application's AWS services..
Why this is the answer
The correct answer is to enable CloudWatch Logs for API Gateway stages with JSON format and use CloudWatch Logs Insights. This is the most efficient solution for searching and analyzing logs across all application services with the least operational overhead. CloudWatch Logs Insights is specifically designed for interactive log analysis and can query logs from various AWS services, including Lambda and API Gateway, directly within CloudWatch. Enabling JSON format for API Gateway logs makes them easily parsable for structured queries. The other options are less suitable: Publishing logs to CloudWatch and querying with Athena is possible but adds more steps and potentially higher operational overhead than Logs Insights for real-time analysis. Route 53 health checks and CloudTrail are for monitoring service availability and API calls, respectively, not for application-level logs or comprehensive root cause analysis of application errors. Kinesis Data Firehose to S3 and then OpenSearch Service is a robust solution for large-scale log aggregation and analysis but involves more setup and operational overhead than simply using CloudWatch Logs Insights for this scenario.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed