From ebfe67a54a8bd587c4572dfee284b0174d19a16c Mon Sep 17 00:00:00 2001 From: Antony Southworth <81115196+antonysouthworth-halter@users.noreply.github.com> Date: Wed, 14 Aug 2024 19:54:08 +1200 Subject: [PATCH] Make the specification of max-buffer-size discoverable. (#20562) * Make the specification of max-buffer-size discoverable. It's not obvious what type of strings are accepted by `max-buffer-size` nor is it obvious what e.g. `4m` means. Four _minutes_? (to me, it looks like something accepted by [ParseDuration](https://pkg.go.dev/time#ParseDuration). Instead we should direct users to the relevant documentation to explain clearly what's allowed and what the units are. * Update configure.md --- content/engine/logging/configure.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/content/engine/logging/configure.md b/content/engine/logging/configure.md index 42f8171b4d..f2f0510a70 100644 --- a/content/engine/logging/configure.md +++ b/content/engine/logging/configure.md @@ -150,9 +150,11 @@ STDERR or STDOUT streams block. The `mode` log option controls whether to use the `blocking` (default) or `non-blocking` message delivery. -The `max-buffer-size` log option controls the size of the buffer used for -intermediate message storage when `mode` is set to `non-blocking`. `max-buffer-size` -defaults to 1 megabyte. +The `max-buffer-size` controls the size of the buffer used for +intermediate message storage when `mode` is set to `non-blocking`. +The default is `1m` meaning 1 MB (1 million bytes). +See [function `FromHumanSize()` in the `go-units` package](https://pkg.go.dev/github.com/docker/go-units#FromHumanSize) for the allowed format strings, +some examples are `1KiB` for 1024 bytes, `2g` for 2 billion bytes. The following example starts an Alpine container with log output in non-blocking mode and a 4 megabyte buffer: