- 1 current stop: learning
- 2 upcoming
- 3 upcoming
- 4 upcoming
- 5 upcoming
Finish after stop 5
Stop 1 of 5 · Garage: the logbook that never gets emptied
Trick to keep in mind+3 XP
Unbounded logs eat the disk: cap with size and file count so old pages get torn out.
Docker's default json-file logging driver keeps every line indefinitely, so a chatty service slowly consumes the host's disk. The fix lives in the logging options: set a maximum file size and a maximum number of files, and Docker rotates and discards the oldest. Restart policies and healthchecks answer different questions.
Read it once, then a question tests whether the trick stuck.