All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Stripe's Canonical Log Line Pattern: Consolidating Logging into Single Structured Events

By

alcazar

2mo ago· 5 min readen

Summary

The article discusses Stripe's approach to logging called 'canonical log lines' or 'wide events,' which involves emitting one structured record per unit of work (like a web request) containing all important fields. This pattern addresses the problem of fragmented logging where different pieces of information are scattered across multiple log lines, requiring manual joins during incident investigations. The approach makes debugging faster, metrics more flexible, and analytics more useful by creating dense, queryable events that summarize entire requests.

Key quotes

· 5 pulled
Most logging is too narrow. One line has the route. Another has the user. Another has the timeout. Another has the feature flag. Another has the deploy SHA. Then an incident happens and you end up doing joins by hand.
Stripe's answer is canonical log lines. The modern name is usually wide events.
The pattern is simple: emit one structured record per unit of work with all the important fields already attached.
For a web service, that usually means one log event at the end of every request.
Canonical log lines turn each request into one dense, queryable event. Done well, they make debugging faster, metrics more flexible, and analytics far more useful.
Snippet from the RSS feed
Canonical log lines turn each request into one dense, queryable event. Done well, they make debugging faster, metrics more flexible, and analytics far more useful.

You might also wanna read