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
