Lambda Advanced Logging Controls Prerequisite

DEA-C01 By islever Editorial Last updated

Short answer

C Configure the Lambda function to use the JSON log format to enable Advanced Logging Controls for distinct application and system log levels.

Question

An application uses an AWS Lambda function that is configured with managed runtimes. The Lambda function successfully writes logs to the default Amazon CloudWatch Logs log group. A data engineer wants to modify the logging behavior to show only ERROR level logs for application logs and WARN level logs for system logs.
Which solution will meet these requirements?
  1. Add additional permissions to the Lambda execution role.
  2. Set the log level to ERROR in the Lambda function code.
  3. Configure the Lambda function to use the JSON log format. Correct Answer
  4. Configure the Lambda function to send logs to a custom log group.

Key Takeaways

Advanced Logging Controls requires JSON log format; without it, separate log level configurations for app and system logs are ignored.

To filter Lambda logs by level for managed runtimes, you must first enable JSON log format, which unlocks Advanced Logging Controls for granular severity settings.

Common mistake: Choosing B assumes code-level filtering suffices, but it cannot suppress runtime system logs like cold start warnings, which Advanced Logging Controls handles.

Expert Analysis

The correct answer is C. The question specifies that the Lambda function uses managed runtimes, which support Advanced Logging Controls. This feature allows developers to configure separate log levels for application logs and system logs directly within the Lambda console or via AWS CLI, without modifying the function code.

However, Advanced Logging Controls has a strict prerequisite: the Lambda function must be configured to use the JSON log format. If the function is using the default text-based log format, the advanced logging controls settings (such as setting app logs to ERROR and system logs to WARN) will not take effect. Therefore, the necessary step to meet the requirement is to switch the log format to JSON.

Let's evaluate the other options:

  • Option A is incorrect because permissions do not control log verbosity or format. The function already successfully writes logs, indicating sufficient permissions.
  • Option B is incorrect because setting the log level in the code affects only application-specific logging statements (e.g., console.error). It does not control the verbose system logs generated by the Lambda runtime (e.g., cold starts, initialization errors), which require the Advanced Logging Controls feature. Furthermore, changing code contradicts the typical efficiency goals of serverless configurations where possible.
  • Option D is incorrect because sending logs to a custom log group does not change the filtering level of the messages contained within those logs.

This topic covers Data Operations and Support, specifically how to manage and monitor data pipelines by optimizing observability. Getting this wrong leads to excessive log storage costs and noise in CloudWatch Insights, making it harder to identify actual errors in data processing pipelines.

Official Reference

https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html

This link opens the official vendor documentation in a new tab.

Exam Strategy

When configuring Lambda observability, always check if the log format supports the desired feature. For managed runtimes, JSON is mandatory for Advanced Logging Controls. Remember that 'code changes' (Option B) are often not the optimal solution when infrastructure configuration can achieve the same result more cleanly.

Frequently Asked Questions

Can I set different log levels for app and system logs in Lambda?

Yes, using Advanced Logging Controls with managed runtimes, you can set separate log levels for application logs and system logs.

Why isn't setting log level in code enough?

Code-level settings only affect your explicit log calls. They do not control the runtime-generated system logs, which require Advanced Logging Controls.

More DEA-C01 FAQ →

Community Votes

B
67%
C
33%

67% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 3 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 3

  1. 9f871d2 👍 2 Answered B
    Option A - permissions has nothing to do with the requirement here. Option C and D are format and cahnging groups. these are not correct answers. B is correct answer to filter out only ERROR messages.
  2. learner2023 👍 1 Answered B
    or Lambda functions with managed runtimes, advanced logging controls allow configuring separate log levels for application logs (ERROR) and system logs (WARN) directly in the function configuration, without code changes
  3. AWS82siast 👍 1 Answered C
    Log format must be JSON for for advanced logging controls.

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All DEA-C01 Questions

Access 100 questions with complete answers and detailed explanations.

View Full DEA-C01 Practice Test →

← Back to DEA-C01 Study Guide