Logs and log rotation
Logging that helps instead of hurting: what to log and at which level, structured JSON logs and correlation IDs, keeping secrets out, where logs go on Linux, rotating files with logrotate and the journal, logs in containers, central log platforms, and retention.
CodexBash, , 6 min read
When something breaks in production, logs are usually the first place you look, and too often they fail you: the message you need was never written, it is buried among a million useless lines, the disk filled up and the application crashed, or a password appears in plain text. Good logging is a small discipline with a large payoff. This article covers what to log, how to format it, how to keep log files from filling disks with log rotation, and how logging works in containers and central platforms.
Sign in to read the rest
The whole 6 minute article is free with an account, along with every problem, lesson and tutorial. No card.