dotnet / dotnet/docker-tools

Add structured logging to ImageBuilder

Offen
#1,908 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area-infrastructure
Vorherrschende Sprache
C#
Sterne
182
Forks
67
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
10

Beschreibung

Adding structured logging to ImageBuilder would allow us to analyze log outputs and operate on log data using jq or other tools.

I propose that we split ImageBuilder's logging into two components:

  • High-level console logging that is concise (fits on ~one terminal screen) and easily parsable by humans and LLMs.
  • Detailed structured logging in json that is output to a file and published as a pipeline artifact. One log per ImageBuilder invocation. Put each log file into one folder and upload one log artifact per pipeline job.

Microsoft.Extensions.Logging does not have file logging support natively. See https://github.com/dotnet/runtime/issues/59322. There are a couple libraries that can provide this functionality through M.E.Logging.Abstractions (using ILogger) - both are popular and in active development:

NLog version 6 fully supports Native AOT/trimming so I lean towards that one.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den ImageBuilder-Einstiegspunkt zu finden und die aktuelle Verwendung von Microsoft.Extensions.Logging zu überprüfen. Untersuche anschließend, wie Pipeline-Jobs Artefakte veröffentlichen, und vergleiche die vorgeschlagenen Ansätze mit Serilog und NLog. Erledigt ist die Aufgabe, wenn eine prägnante Konsolenausgabe, ein strukturiertes JSON-Log pro Aufruf und ein hochgeladenes Log-Artefakt pro Pipeline-Job vorhanden sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

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

Neue Issues direkt in Ihr Postfach

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