Azure / Azure/Azure-Functions

Custom Handler Logging

Offen
#2,575 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PowerShell
Sterne
1.1k
Forks
215
Ø Merge
4 Std. 2 Min.
Gemergte PRs (30 T.)
1

Beschreibung

According to https://learn.microsoft.com/en-us/azure/azure-functions/functions-custom-handlers#response-payload when the handler response contains a Logs array, these are shown in the invocation logs.

For example:

```json
{
"Outputs": {
"res": {
"Headers": {"Content-Type": "application/json"},
"statusCode": 200,
"body": {"message": "Order received for P01 qty 1"}
}
},
"Logs": ["Order received for P01", "Order quantity 1"]
}
```

The invocation logs never include these log entries. In fact the Invocations form does not even show successful invocations and searching through trace logs, these Logs entries are never found.

In addition, searching through trace logs, there's also no invocation id and its also impossible to determine which function endpoint is responsible for generating the trace logs.

Is there any more documentation for custom handler logging so that logs produced are of similar quality and use when using the supported sdks eg node or C#? I have some working handlers using https://bun.sh/ but they are useless without logging.

Ideally I'd like to achieve:

- Shows successful invocations per function endpoint
- Search trace logs per invocation and/or per endpoint
- Reduce the logs noise. Filter traces on custom (console logs) and filter out function host logs

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, eine Antwort eines benutzerdefinierten Bun-Handlers mit einem Logs-Array zu reproduzieren, und vergleiche das Ergebnis mit der Dokumentation zu benutzerdefinierten Handlern von Azure Functions. Prüfe das Formular Invocations und die Trace-Logs auf erfolgreiche Invocations, Invocation-IDs, Endpoint-Zuordnung und Filterverhalten. Als abgeschlossen gilt die Aufgabe, wenn die gemeldeten Logging-Informationen verfügbar sind und die angeforderte Dokumentation oder Einschränkung eindeutig identifiziert wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
bun
Bereich
observability
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

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