Twelve Factor App - Logs
A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout. During local development, the developer will view this stream in the foreground of their terminal to observe the app’s behavior.
In staging or production deploys, each process’ stream will be captured by the execution environment, collated together with all other streams from the app, and routed to one or more final destinations for viewing and long-term archival. These archival destinations are not visible to or configurable by the app, and instead are completely managed by the execution environment. Open-source log routers (such as Logplex and Fluentd) are available for this purpose.
References
#twelve #factor #app #webapp #scaling #internet #saas #software #as #a #service #api #codebase #dependencies #config #tfa #backing services #build #release #run #processes #sql #database #port #binding #concurrency #disposability #dev/prod #development #production #container #parity #logs #admin