# Log Levels

Log levels classify application log events by severity or diagnostic detail so engineers can control what is recorded and prioritize investigation.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/log-levels

> Applications assign levels such as DEBUG, INFO, WARN, and ERROR to log events, while logging configuration determines which events are emitted or retained. Consistent levels make application behavior easier to understand, reduce unnecessary logging costs, and help engineers identify failures without losing useful operational context.

Practice exams covering Log Levels: [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate).

## 6 key aspects of Log Levels

Effective log levels combine consistent severity definitions, configurable verbosity, structured context, and operational controls that balance diagnostic value against noise, cost, and risk.

1. **Consistent severity semantics**: Define what each level means for the application and apply those definitions across components. Distinguish recoverable conditions from failed operations so warnings and errors remain useful.
2. **Threshold-based verbosity**: A configured minimum level generally permits that level and more severe events. Check logger, handler, collector, and destination settings when diagnosing missing records.
3. **Structured diagnostic context**: Record severity as a structured field alongside timestamps, operation details, and request or trace identifiers. This enables reliable filtering and correlation without parsing severity from free-form messages.
4. **Controlled production diagnostics**: Use an appropriate production baseline and temporarily increase detail for affected components during troubleshooting. Make changes controlled and reversible to limit overhead and excess data collection.
5. **Cost and security boundaries**: Suppress unnecessary detail before ingestion when possible, and configure retention independently. Redact secrets and sensitive data at every level, including DEBUG and TRACE.
6. **Actionable alerting**: Use severity to support detection, but combine it with frequency, duration, and operational impact. A single ERROR event does not necessarily justify paging an engineer.

## Cloud services for Log Levels

Applications running in Lambda or Amazon ECS assign severity and diagnostic context before emitting records. CloudWatch Logs centralizes those records for investigation, and metric filters can feed CloudWatch alarms when selected error patterns occur. Where broader indexed analysis is needed, a configured ingestion pipeline can also deliver logs to Amazon OpenSearch Service for cross-service searches and dashboards. Across these paths, preserve severity and correlation identifiers, control verbosity near the source, and configure retention and access independently of log levels.

- **[AWS Lambda](https://blowstack.com/tools/cloud-services-hub/aws-lambda)**: Sends function logs to CloudWatch Logs when the execution role has the required permissions. Advanced logging controls support separate application and system log-level settings, with application-level filtering requiring supported JSON-formatted log records.
- **[Amazon OpenSearch Service](https://blowstack.com/tools/cloud-services-hub/amazon-opensearch-service)**: Indexes log records for searches, aggregations, and dashboards based on severity and other fields. Consistent field mappings and severity conventions help engineers compare failures across services.

## Log Levels exam questions

Real practice exam questions on Log Levels, with the correct answer and its explanation.

### Question 1 (DVA-C02)

**Question:**

A developer maintains a Python AWS Lambda function that processes orders. The function uses Python's standard logging library, and its logger is configured to emit DEBUG and higher-severity messages. Each message includes an order ID, an operation name, and a severity. The function's execution role already permits delivery to Amazon CloudWatch Logs.

During normal operation, only application messages at WARN and higher severity must be delivered to CloudWatch Logs. During an investigation, operators must be able to include DEBUG and higher-severity application messages without changing application code. Lambda platform messages, including START, END, and REPORT, must remain available in both cases.

Which solution meets these requirements?

**Correct answer:** Enable Lambda JSON logging. Set ApplicationLogLevel to WARN and SystemLogLevel to INFO. During an investigation, change ApplicationLogLevel to DEBUG.

**Explanation:** Lambda advanced logging controls support separate severity thresholds for application and system logs when JSON logging is enabled. WARN retains application warnings and more severe events, while DEBUG includes diagnostic messages. Keeping SystemLogLevel at INFO preserves platform messages such as START, END, and REPORT. Because the Python logger already emits DEBUG and higher-severity messages, operators can adjust the Lambda application threshold without changing code.

## Practice Log Levels in a full exam

Questions on Log Levels in each practice exam, with every answer option and an explanation for each:

- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 2 questions

## What is Log Levels

Log levels express the significance of an application event and help control logging verbosity. A common ordering, from most detailed to most severe, is TRACE, DEBUG, INFO, WARN, ERROR, and FATAL or CRITICAL. Frameworks differ in their supported names and numeric values, so applications should define and document their conventions rather than assume that every logging system uses the same scale.

TRACE typically captures fine-grained execution details, while DEBUG records information useful during diagnosis, such as retry decisions or selected configuration values. INFO describes expected operational events, such as a job starting or an order completing. WARN identifies an unexpected condition that does not currently prevent the operation from succeeding, such as a dependency timeout followed by a successful retry. ERROR indicates that an operation failed. FATAL or CRITICAL usually describes a condition that prevents a process or major component from continuing, although assigning that level does not itself terminate the process.

A logger's configured threshold normally includes that level and more severe levels. For example, an INFO threshold generally emits INFO, WARN, ERROR, and FATAL events while suppressing DEBUG and TRACE. Setting DEBUG therefore increases diagnostic detail; it does not mean recording only DEBUG events. Handler, collector, and destination filters can impose additional restrictions, so engineers must check the complete logging pipeline when an expected event is missing.

In cloud applications, use a logging library rather than scattered unstructured print statements. Emit structured records, commonly JSON, with a timestamp, severity, service name, deployment environment, message, and request or trace identifier. Include relevant application state, such as an operation name, attempt count, duration, or sanitized error code. For a payment request, an INFO event might record completion, a WARN event might describe a recoverable retry, and an ERROR event might record failure after retries are exhausted. Avoid repeatedly logging the same exception at every layer; capture it where useful context and the final outcome are known.

Production applications often use INFO as a baseline and temporarily enable DEBUG for a specific component during an incident. This is a starting point, not a universal rule: high-throughput applications may need more selective logging. Configure levels through deployment settings or controlled runtime configuration, and restore normal verbosity after troubleshooting. More verbose logging increases ingestion, storage, and query costs and may add CPU, serialization, and network overhead. Guard expensive diagnostic calculations because some logging APIs evaluate arguments even when the event is suppressed.

Centralized cloud logging services collect and search records, but collection alone does not guarantee correct severity classification. Configure severity in application instrumentation and preserve it through transport. Filtering a search to ERROR does not recover DEBUG events that the application never emitted, nor does it avoid the ingestion cost of records already collected. Establish retention and access controls separately from severity thresholds.

Severity must reflect application impact rather than exception presence alone. An expected validation rejection is not automatically an ERROR, and a recovered transient failure need not trigger paging. Build alerts from meaningful error rates, repeated failures, or customer impact rather than every individual error record. Never log credentials, tokens, or sensitive payloads at any level; DEBUG is not a security exemption. Finally, logs complement metrics and traces: severity helps prioritize events, while correlation identifiers connect those events across distributed requests.
