adamflott.com

Adamantium - I - Rules of Logging

Date: 2020-02-03

1 Rules of Logging

A list of rules I've come to use when deciding how to log in backend systems. Note, the examples are real.

1.1 Log Data Not Prose

1.2 Log Data To Fit Your Domain

1.3 Many Levels Aren't As Useful As You Think

1.4 Log Relevant Data

1.5 Avoid Duplicating Already Logged Data

1.6 Serialization Format Matters Less Than The Content

1.7 JSON Is Terrible

1.7.1 Cons

1.7.2 Pros

1.8 Encode as UTF-8 or ASCII

1.9 Don't Worry About Big Data Until You Can't Purchase Hardware Large Enough to Handle It

1.10 Require Dynamic Runtime Volume Adjustment

1.11 Buffer Before Bailing