fix(lambda): pass LoggingConfig log format and level to the runtime (#6775)

* fix(lambda): pass LoggingConfig log format and level to the runtime

A function with LogFormat=JSON logged text: neither launcher set AWS_LAMBDA_LOG_FORMAT or AWS_LAMBDA_LOG_LEVEL, which the runtime interface clients read. Both launchers now pass them, and a JSON function without an ApplicationLogLevel gets INFO, the level the API reports, through one default shared with the response.

Closes #6774

* docs(lambda): note the log format and level the runtime receives

* refactor(lambda): build the runtime environment in one place for both launchers

ContainerLauncher and KubernetesPodLauncher wrote the same AWS_LAMBDA_* lines, the LoggingConfig ones included. LambdaRuntimeEnv.of now builds them once.
This commit is contained in:
Francisco Javier Barón authored and GitHub committed 2026-10-28 09:04:14 -04:00
1 parent 119b7e9580
commit 481b7f8d6d
8 files changed
+98 -23

No files matched your search

+5
View File
@@ -978,6 +978,11 @@ exist, and `AWS_LAMBDA_LOG_GROUP_NAME` names that group. Once a group is named,
functions can share, each stream's name carries the function's name, as on AWS:
`2026/10/16/my-fn[$LATEST]<id>` rather than the default group's `2026/10/16/[$LATEST]<id>`.
The execution environment gets `AWS_LAMBDA_LOG_FORMAT` from `LogFormat` and, under `LogFormat=JSON`,
`AWS_LAMBDA_LOG_LEVEL` from `ApplicationLogLevel` (`INFO` when unset, the level the API reports).
The runtime interface clients read both: a Python function writes each record as a JSON object,
`extra` keys included, and drops records under the level.
`DurableConfig` requires `ExecutionTimeout` on create. A durable function created without
a `Timeout` gets `min(ExecutionTimeout, 900)`. It always logs in JSON format, and
`LogFormat: Text` is rejected. On update the members are merged, and a function created