awslabs / awslabs/aws-lambda-powershell-runtime

JSON logging support

Offen
#40 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PowerShell
Sterne
65
Forks
21
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit dem Lesen der verlinkten AWS Lambda-Dokumentation zur Protokollierung und verfolgen Sie, wie AWS_LAMBDA_LOG_FORMAT mit der bestehenden Behandlung von Write-Host, Write-Debug, -Verbose, -Warning, Write-Information und impliziten ErrorRecords durch die Laufzeit zusammenhängt. Als abgeschlossen gilt die Definition und Implementierung des JSON- und Klartextverhaltens für laufzeitinterne, kundenseitige, strukturierte und implizite Protokollereignisse.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
aws, powershell
Bereich
cloud, observability-sre
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.