liveBook · Manning

Twelve-factor application

As explained in Logs and Telemetry

The twelve-factor app is a methodology for building software-as-a-service applications according to twelve principles covering configuration, deployment, processes, and operational behavior.

A twelve-factor application separates event production from log routing and storage. Each running process emits an unbuffered, continuous event stream; the execution environment captures, collates, routes, and archives it. section 3.3

Apply the logging principle with these operational choices:

  • During local development, observe the process stream directly in the foreground terminal. section 3.3
  • In staging and production, let the execution environment capture and route streams to files, real-time tails, archives, or analysis systems. section 3.3
  • Keep routing and storage outside application logic, but use a logging framework when filtering, consistent structure, adjustable detail, or targeted suppression matters. section 3.3.1
Listing 3.2 Capturing stdout
[SERVICE]
  flush 1

[INPUT]
  name stdin        #1
  tag book_stdout       #2

[OUTPUT]
  match *
  name file
  path .
  file captured.txt

A minimal Fluent Bit configuration captures standard input and writes the resulting stream to captured.txt, illustrating externalized collection and routing. section 3.3.1

How Logs and Telemetry covers it

How deep it goes
Defines continuous stdout streams and environment-managed routing, then questions literal stdout-only practice without detailing the other factors.
Examples
Uses terminal output, Fluent Bit, Logplex, Fluentd, Splunk, Hadoop/Hive, files, and real-time tails as logging examples.
What it assumes
Assumes familiarity with application processes and log output, while establishing the separation between emitting events and managing destinations.
What you can do after
Apply it via stdout emission and externally configured collection while retaining framework-based control over filtering and structure.
How it connects
Connects application processes with logging frameworks, execution environments, log routers, and log indexing systems.

Related concepts

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