docker-tools icon indicating copy to clipboard operation
docker-tools copied to clipboard

Add structured logging to ImageBuilder

Open lbussell opened this issue 3 weeks ago • 0 comments

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.

lbussell avatar Dec 23 '25 22:12 lbussell