Logging¶
Core Idea¶
A system records its own events as they occur — append-only, timestamped, self-describing — so that an actor not present at the original moment can inspect the record later. The substrate-independent move is record now, interpret later.
How would you explain it like I'm…
The Never-Erase Diary
The Captain's Logbook
Record Now, Read Later
Broad Use¶
- Software: application logs, distributed traces, write-ahead logs, and audit trails — the canonical home.
- Science: the signed lab notebook, a timestamped append-only record for replicability.
- Law: court records, chains-of-custody, and minutes, with penalties enforcing append discipline.
- Medicine: the medical chart and medication-administration record, on which continuity of care depends.
- Finance: double-entry bookkeeping and the general ledger — the canonical pre-digital log.
- Aviation: the flight data recorder, where after-incident inspection is the consumer.
- Natural archives: tree rings, ice cores, and sedimentary strata accreting append-only entries read off later.
Clarity¶
Separates the act of recording from the act of inspecting, exposing the error of "we'll record what we need when we realise we need it" — by then the event has passed — and drawing a sharp line between the log (what happened) and current state (what is true now).
Manages Complexity¶
Compresses design and governance to a small decision set — what events to log, what context each carries, how long to retain, who may read — and collapses whole industries of after-the-fact inspection into one shape: retrospective inspection of an event-time log.
Abstract Reasoning¶
Supports the log-determinism inference: if behaviour is a function only of the log plus deterministic processing, replaying the log reproduces the behaviour — the justification for event sourcing, blockchain validation, and double-entry audit alike.
Knowledge Transfer¶
- Accounting to databases: the append-only ledger and its trustworthiness argument transfer verbatim to event-sourcing and write-ahead logging.
- Aviation to medicine: the record-always-review-on-incident model ported into operating-theatre recording and incident review.
- Engineering to geology: ice cores and tree rings are read using the engineered-log vocabulary of "log resolution" and "missing entries."
Example¶
A database write-ahead log records each transaction's change before applying it, append-only and ordered; after a crash the recovery process — a deferred inspector, not the original transaction — replays committed entries to reconstruct the correct state.
Relationships to Other Primes¶
Parents (1) — more general patterns this builds on
- Logging presupposes, typical Observability — Logging is the append-only, event-time, deferred-reading mechanism that makes a system's internal history externally inspectable — it presupposes/serves observability (infer internal state externally), as its retrospective record-now-interpret-later instance.
Path to root: Logging → Observability
Not to Be Confused With¶
- Logging is not Monitoring because the former is append-only event-time recording for a deferred inspector, whereas monitoring observes current state and alerts so someone can act now.
- Logging is not Provenance because the former is a chronological record of events, whereas provenance is the derivation lineage of an artifact answering "how did this come to be?"
- Logging is not Traceability because the former is a time-ordered event record, whereas traceability is the link structure between related items that a log may support but is not.