liveBook · Manning

Log

As explained in Grokking Software Architecture

The recording of software events, states, or diagnostic information for operational analysis.

Logs preserve emitted events that help reconstruct what happened when a distributed system fails. When interactive debugging is unavailable, they can provide the evidence needed to connect symptoms. section 7.6 section 7.6.3

Treat logging as a technical concern that can be kept separate from business logic:

  • Inject a logger through an abstraction so implementations can be swapped without changing business logic. section 4.5.3
  • Pass a fake logger in unit tests to check that logging is attempted without writing to a real file. section 4.5.3
  • Keep business logic focused by assigning logging its own responsibility; frameworks can also weave logging in automatically. section 4.5.3

Apollo 13: connecting the clues

Sy Liebergot correlated the oxygen-pressure drop with fuel-cell power loss. The matching event patterns revealed a shared cause, rather than two unrelated failures. section 7.6.3

How Grokking Software Architecture covers it

How deep it goes
Explains logger injection, testing, and failure reconstruction without detailing log formats or recording mechanics.
Examples
Uses an injected OrderService logger and Apollo 13 event correlations to illustrate testing and diagnosis.
What you can do after
Diagnose failures by correlating emitted events when interactive debugging is unavailable.
How it connects
Connects logging to dependency injection, separation of concerns, aspect-oriented programming, and event-driven architecture.

Also explained in

Compare how 21 books explain log →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.