Problem
MinimalLambda log-level behavior is unclear in deployed Lambda functions, especially when combining:
- MinimalLambda default logging (
LambdaApplication.CreateBuilder()) Microsoft.Extensions.Logging configuration- AWS Lambda runtime support /
ILambdaLogger - Lambda Advanced Logging Controls (
loggingFormat: JSON, application/system log levels) - third-party providers such as AWS Lambda Powertools for .NET
In a consumer app, setting AWS_LAMBDA_HANDLER_LOG_LEVEL=Warning did not suppress information logs as expected. Earlier attempts with Logging__LogLevel__Default=Warning and POWERTOOLS_LOG_LEVEL=Warning were also unclear because they affect different layers/providers.
Current code path observed
MinimalLambda default builder adds logging here:
Services.AddLogging(logging =>{logging.AddConfiguration(Configuration.GetSection("Logging"));logging.AddSimpleConsole();logging.Configure(options =>{options.ActivityTrackingOptions=ActivityTrackingOptions.SpanId|ActivityTrackingOptions.TraceId|ActivityTrackingOptions.ParentId;});});So standard .NET configuration like this appears relevant for ILogger filtering:
Logging__LogLevel__Default=Warning
MinimalLambda also uses Amazon.Lambda.RuntimeSupport / LambdaBootstrap, so AWS runtime settings may be relevant for ILambdaLogger, e.g.:
AWS_LAMBDA_HANDLER_LOG_LEVEL=Warning
For Lambda Advanced Logging Controls with custom runtimes, AWS docs mention runtime-facing variables:
AWS_LAMBDA_LOG_LEVEL
AWS_LAMBDA_LOG_FORMAT
Powertools for AWS Lambda (.NET) has its own provider setting:
POWERTOOLS_LOG_LEVEL=Warning
Requested docs / clarification
Please document how log-level configuration flows through MinimalLambda, including:
- Which settings affect
ILogger<T> created through MinimalLambda defaults. - Which settings affect
ILambdaLogger / context.Logger. - Whether
AWS_LAMBDA_HANDLER_LOG_LEVEL applies to MinimalLambda custom-runtime apps, or only managed .NET runtimes / specific logging paths. - How Lambda Advanced Logging Controls interact with MinimalLambda (
loggingFormat: JSON, ApplicationLogLevel, SystemLogLevel, AWS_LAMBDA_LOG_LEVEL, AWS_LAMBDA_LOG_FORMAT). - How third-party logging providers such as AWS Lambda Powertools fit in, and whether users should set provider-specific variables (
POWERTOOLS_LOG_LEVEL) in addition to or instead of standard .NET logging config. - Recommended CDK examples for common cases:
- MinimalLambda default logging only
- MinimalLambda + Powertools
- Lambda service-side filtering via Advanced Logging Controls
Helpful expected outcome
A docs section/table like:
| Logging path | API used | Config key/env var | Value format | Notes |
|---|
Default ILogger | ILogger<T> | Logging__LogLevel__Default | Warning | Standard Microsoft.Extensions.Logging |
| AWS Lambda logger | ILambdaLogger | AWS_LAMBDA_HANDLER_LOG_LEVEL or other | Warning? | Clarify applicability |
| Lambda ALC | Lambda service filter | CDK applicationLogLevel / AWS_LAMBDA_LOG_LEVEL | WARN | Service-side filtering |
| Powertools | Powertools provider | POWERTOOLS_LOG_LEVEL | Warning | Provider-specific |
Goal: make deployed log-level behavior predictable and avoid trial-and-error across runtime/provider/service filtering layers.
Problem
MinimalLambda log-level behavior is unclear in deployed Lambda functions, especially when combining:
LambdaApplication.CreateBuilder())Microsoft.Extensions.LoggingconfigurationILambdaLoggerloggingFormat: JSON, application/system log levels)In a consumer app, setting
AWS_LAMBDA_HANDLER_LOG_LEVEL=Warningdid not suppress information logs as expected. Earlier attempts withLogging__LogLevel__Default=WarningandPOWERTOOLS_LOG_LEVEL=Warningwere also unclear because they affect different layers/providers.Current code path observed
MinimalLambda default builder adds logging here:
So standard .NET configuration like this appears relevant for
ILoggerfiltering:MinimalLambda also uses
Amazon.Lambda.RuntimeSupport/LambdaBootstrap, so AWS runtime settings may be relevant forILambdaLogger, e.g.:For Lambda Advanced Logging Controls with custom runtimes, AWS docs mention runtime-facing variables:
Powertools for AWS Lambda (.NET) has its own provider setting:
Requested docs / clarification
Please document how log-level configuration flows through MinimalLambda, including:
ILogger<T>created through MinimalLambda defaults.ILambdaLogger/context.Logger.AWS_LAMBDA_HANDLER_LOG_LEVELapplies to MinimalLambda custom-runtime apps, or only managed .NET runtimes / specific logging paths.loggingFormat: JSON,ApplicationLogLevel,SystemLogLevel,AWS_LAMBDA_LOG_LEVEL,AWS_LAMBDA_LOG_FORMAT).POWERTOOLS_LOG_LEVEL) in addition to or instead of standard .NET logging config.Helpful expected outcome
A docs section/table like:
ILoggerILogger<T>Logging__LogLevel__DefaultWarningILambdaLoggerAWS_LAMBDA_HANDLER_LOG_LEVELor otherWarning?applicationLogLevel/AWS_LAMBDA_LOG_LEVELWARNPOWERTOOLS_LOG_LEVELWarningGoal: make deployed log-level behavior predictable and avoid trial-and-error across runtime/provider/service filtering layers.