awslabs / awslabs/aws-lambda-powershell-runtime

JSON logging support

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
65
Forks
21
PR merge metrics
No merged PRs in 30d

Description

AWS Lambda offers support for both [plain-text and JSON format logs](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-cloudwatchlogs-logformat.html).

Lambda exposes this configuration via the `AWS_LAMBDA_LOG_FORMAT` environment variable. It's currently missing from the [environment variable documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime) (see case 175226052300866), but the variable appears to be set to either `Text` or `JSON` depending on customer configuration.

There's a couple of aspects to supporting this:
* Runtime-intrinsic logs (e.g. anything that's `Write-Host '[RUNTIME-<...>'`)
* Customer logs that use:
* Unstructured string-only logs (`Write-Debug`, `-Verbose`, `-Warning`)
* Unstructured partially-formatted logs (`Write-Host`)
* Structured logs via `Write-Information`
* Implicit log events (e.g. ErrorRecords generated from parser errors)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.