From 3e822bad827087f2000e69a59b8c81e6f3e865f7 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Mon, 28 May 2018 10:28:52 -0500 Subject: [PATCH] Add a slide about JSON file and log rotation --- slides/intro/Logging.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/slides/intro/Logging.md b/slides/intro/Logging.md index c5b463c3..6e88b8ca 100644 --- a/slides/intro/Logging.md +++ b/slides/intro/Logging.md @@ -131,6 +131,27 @@ We will then show one particular method in action, using ELK and Docker's loggin --- +## A word of warning about `json-file` + +- By default, log file size is unlimited. + +- This means that a very verbose container *will* use up all your disk space. + + (Or a less verbose container, but running for a very long time.) + +- Log rotation can be enabled by setting a `max-size` option. + +- Older log files can be removed by setting a `max-file` option. + +- Just like other logging options, these can be set per container, or globally. + +Example: +```bash +$ docker run --log-opt max-size=10m --log-opt max-file=3 elasticsearch +``` + +--- + ## Demo: sending logs to ELK - We are going to deploy an ELK stack.