This is just structured logging. Slog in go, tracing in rust, serilog in C#, etc. You should be combining this with the likes of otel or datadog, which will keep those fields structured and filterable.
Wide logging: Stripe's canonical log line pattern
11–13 of 13 posts
Re: Wide logging: Stripe's canonical log line pattern
#12I’ve never been so conflicted about an article. It has clearly been generated by an llm, but still has useful content. It’s a good article, but…
Re: Wide logging: Stripe's canonical log line pattern
#13Are there any restrictions on how short the error_slug should be? The meat of some of my errors can be pretty long (for example an ffmpeg error). There are also many phases to a job - call them tasks. Can a canonical log line be a collection of task log lines?
You should avoid dumping the raw error entirely. The idea is that error_slug is a stable grouping key. The idea is to consolidate all that can be grouped into one logical unit. So you would do one long log line at the end, after all tasks are done.
I see one of your responses that this is a complement to an existing logging system - a one line summary. That works for me.