Skip to Content
Beyond the Twelve-Factor App
book

Beyond the Twelve-Factor App

by Kevin Hoffman
April 2016
Intermediate to advanced
70 pages
1h 11m
English
O'Reilly Media, Inc.
Content preview from Beyond the Twelve-Factor App

Chapter 6. Logs

In this chapter, I discuss the 11th factor, logs.

Logs should be treated as event streams, that is, logs are a sequence of events emitted from an application in time-ordered sequence. The key point about dealing with logs in a cloud-native fashion is, as the original 12 factors indicate, a truly cloud-native application never concerns itself with routing or storage of its output stream.

Sometimes this concept takes a little bit of getting used to. Application developers, especially those working in large enterprises, are often accustomed to rigidly controlling the shape and destination of their logs. Configuration files or config-related code set up the location on disk where the log files go, log rotation and rollover policies to deal with log file size and countless other minutiae.

Cloud applications can make no assumptions about the file system on which they run, other than the fact that it is ephemeral. A cloud-native application writes all of its log entries to stdout and stderr. This might scare a lot of people, fearing the loss of control that this implies.

You should consider the aggregation, processing, and storage of logs as a nonfunctional requirement that is satisfied not by your application, but by your cloud provider or some other tool suite running in cooperation with your platform. You can use tools like the ELK stack (ElasticSearch, Logstash, and Kibana), Splunk, Sumologic, or any number of other tools to capture and analyze your log emissions. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Applications with AI Agents

Building Applications with AI Agents

Michael Albada
AI Agents in Action

AI Agents in Action

Micheal Lanham
Developing Apps with GPT-4 and ChatGPT

Developing Apps with GPT-4 and ChatGPT

Olivier Caelen, Marie-Alice Blete
The DevOps Handbook

The DevOps Handbook

Gene Kim, Jez Humble, Patrick Debois, John Willis

Publisher Resources

ISBN: 9781492042631