4 ms·
I've found a lot of value with canonical logging[0] for server-side logging. Basically, we emit one log per request/response with appropriate severity level (I
by gmurthy_ 6y ago
I've found a lot of value with canonical logging[0] for server-side logging.
Basically, we emit one log per request/response with appropriate severity level (INFO if request succeeded, ERROR if it failed) and the log contains all the interesting information that we care to log. This makes it very easy to track and debug issues at an individual request level, while not having to overly rely on external tools to parse/combine logs to reconstruct requests/sessions.
The other benefit of this is that we can feed these logs directly into log ingestion tools like Datadog and plot graphs, view distributions and set alerts on metrics present in logs.
[0] https://stripe.com/blog/canonical-log-lines https://stripe.com/blog/canonical-log-lines
- 3pt14159 6y agoFrom the linked article: > in addition to their normal log traces Does this mean that normal logging happens outside the final log line? If so, then that sounds great. Otherwise I'd worry about losing state due to a bug.
- wsargent 6y agoThis is also known as an "event" in Honeycomb parlance. https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/ https://www.honeycomb.io/blog/how-are-structured-logs-differ...