diff --git a/README.md b/README.md index 4a96a3f..5248e69 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,16 @@ def handler(event, context): return "Hello World!" ``` +### Structured (JSON) logging + +When the function is configured to emit JSON-formatted logs (`AWS_LAMBDA_LOG_FORMAT=JSON`), logs written by the runtime for uncaught errors include the log level under the `level` key, e.g.: + +```json +{"timestamp": "...", "level": "ERROR", "errorType": "...", "errorMessage": "...", "stackTrace": ["..."]} +``` + +If you parse these logs, read the level from `level` (this field was previously emitted as `log_level`). + ### Local Testing To make it easy to locally test Lambda functions packaged as container images we open-sourced a lightweight web-server, Lambda Runtime Interface Emulator (RIE), which allows your function packaged as a container image to accept HTTP requests. You can install the [AWS Lambda Runtime Interface Emulator](https://github.com/aws/aws-lambda-runtime-interface-emulator) on your local machine to test your function. Then when you run the image function, you set the entrypoint to be the emulator. diff --git a/RELEASE.CHANGELOG.md b/RELEASE.CHANGELOG.md index a3fe32c..153556f 100644 --- a/RELEASE.CHANGELOG.md +++ b/RELEASE.CHANGELOG.md @@ -1,3 +1,7 @@ +### September 15, 2026 +`4.0.4` +- Use the `level` key (instead of `log_level`) for the log level field in JSON-formatted uncaught error logs, aligning it with the key used by other structured log events ([#221](https://github.com/aws/aws-lambda-python-runtime-interface-client/pull/221)) + ### September 2, 2026 `4.0.3` - Emit a structured `runtime_worker_pool_initializing` DEBUG log event once per execution environment during INIT in multi-concurrent (Lambda Managed Instances) mode, reporting `workerCount` and `executionEnvironmentMaxConcurrency` for worker pool observability. Only visible when the function log level is DEBUG or lower; no impact on the standard on-demand path. diff --git a/awslambdaric/__init__.py b/awslambdaric/__init__.py index f00368b..b479cf6 100644 --- a/awslambdaric/__init__.py +++ b/awslambdaric/__init__.py @@ -2,4 +2,4 @@ Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. """ -__version__ = "4.0.3" +__version__ = "4.0.4"