AWS Certified Developer Associate DVA-C02 Practice Question
Your application running on AWS Lambda is designed to process transactions and write logs to Amazon CloudWatch. You have noticed that the logs are difficult to search through when troubleshooting issues due to inconsistent formatting. To improve this, you decide to implement structured logging. Which approach would ensure that your logs are consistent and easily queryable?
Use plain text logs with clear and consistent prefixes for each line.
Log the output as comma-separated values (CSV) with consistent ordering of information for each entry.
Adopt XML formatted logs, where each entry is structured with relevant data tags.
Format all log entries as JSON with consistent key-value pairs for each type of log message.
Using JSON format for logs would ensure that each log entry is consistent and can be easily parsed and queried. JSON is a widely-known format which can be directly used with services like Amazon CloudWatch Logs Insights to run complex queries. By contrast, CSV lacks a self-describing format and the absence of keys can make it harder to interpret. Plain text logs lack structured data, making them difficult to query programmatically. Although XML is also structured, it is more verbose and not as readily queryable within AWS services as JSON.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is structured logging and why is it important?
Open an interactive chat with Bash
Why is JSON preferred over CSV or plain text for logging in AWS?
Open an interactive chat with Bash
Can you explain how Amazon CloudWatch Logs Insights works with structured logs?
Open an interactive chat with Bash
AWS Certified Developer Associate DVA-C02
Troubleshooting and Optimization
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access