From bfceda4d636a97db153ab14b0cd457342526d3d3 Mon Sep 17 00:00:00 2001 From: Vitaliy Zhiltsov Date: Fri, 19 Aug 2022 15:03:40 +0700 Subject: [PATCH 1/2] added logs.mdx page --- src/docs/self-hosted/index.mdx | 1 + src/docs/self-hosted/logs.mdx | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/docs/self-hosted/logs.mdx diff --git a/src/docs/self-hosted/index.mdx b/src/docs/self-hosted/index.mdx index 2ed2b48984..83940b1a94 100644 --- a/src/docs/self-hosted/index.mdx +++ b/src/docs/self-hosted/index.mdx @@ -82,6 +82,7 @@ Here is further information on specific configuration topics related to self-hos - [Email](/self-hosted/email/) - [Geolocation](/self-hosted/geolocation/) - [Single Sign-On (SSO)](/self-hosted/sso/) +- [Logs rotaion](/self-hosted/logs/) ## Productionalizing diff --git a/src/docs/self-hosted/logs.mdx b/src/docs/self-hosted/logs.mdx new file mode 100644 index 0000000000..ec724c850c --- /dev/null +++ b/src/docs/self-hosted/logs.mdx @@ -0,0 +1,22 @@ +--- +title: "Logs rotation" +--- + +By default docker writes logs of a container to one log file which can be giant - tens of gigabytes. + +To reduce a used space for logs you can + * modify docker-compose.yaml file by adding into a common section for each container following logging settings: + +``` +x-restart-policy: &restart_policy + restart: unless-stopped + logging: + driver: "json-file" + options: + max-size: "20m" + max-file: "10" +``` + +And docker daemon will automatically control size of a log file for each container from the yaml file: 20Mb * 10 = 200Mb for each container. Offical documentaion about those settings. + + * modify a docker daemon log settings to apply them to all newly created containers. From 25a6d3cf74002a8c9210ffbedabb357ec269aef2 Mon Sep 17 00:00:00 2001 From: Vitaliy Zhiltsov <30690817+vzhgit@users.noreply.github.com> Date: Sun, 21 Aug 2022 23:58:41 +0700 Subject: [PATCH 2/2] Update src/docs/self-hosted/logs.mdx modify docker-compose.yml file and add following common logging setting and apply it either for each container or only for containers with huge log files: Co-authored-by: Amin Vakil --- src/docs/self-hosted/logs.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/self-hosted/logs.mdx b/src/docs/self-hosted/logs.mdx index ec724c850c..3adf364372 100644 --- a/src/docs/self-hosted/logs.mdx +++ b/src/docs/self-hosted/logs.mdx @@ -5,7 +5,7 @@ title: "Logs rotation" By default docker writes logs of a container to one log file which can be giant - tens of gigabytes. To reduce a used space for logs you can - * modify docker-compose.yaml file by adding into a common section for each container following logging settings: + * modify docker-compose.yml file and add following logging settings into a common section for each container: ``` x-restart-policy: &restart_policy