awslabs / awslabs/aws-lambda-powershell-runtime

JSON logging support

未关闭
#40 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
PowerShell
星标
65
派生
21
PR 合并指标
30 天内没有已合并 PR

描述

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)

贡献指南

打开贡献指南

调研方向

首先阅读链接的 AWS Lambda 日志记录文档,并追踪 AWS_LAMBDA_LOG_FORMAT 与 runtime 现有对 Write-Host、Write-Debug、-Verbose、-Warning、Write-Information 以及隐式 ErrorRecords 的处理之间的关系。完成标准是为 runtime 固有、客户、结构化和隐式日志事件定义并实现 JSON 和纯文本行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, powershell
领域
cloud, observability-sre
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。