{"id":2061,"date":"2020-09-17T10:49:16","date_gmt":"2020-09-17T07:49:16","guid":{"rendered":"https:\/\/artem.services\/?p=2031"},"modified":"2020-11-09T14:17:53","modified_gmt":"2020-11-09T11:17:53","slug":"2061","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=2061&lang=en","title":{"rendered":"Docker Compose &#8212; Setting log size limit"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-27\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo.png\" alt=\"\" width=\"1800\" height=\"531\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo.png 1800w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-300x89.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-768x227.png 768w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-1024x302.png 1024w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-954x281.png 954w, https:\/\/artem.services\/wp-content\/uploads\/2018\/10\/Docker-Logo-1354x399.png 1354w\" sizes=\"(max-width: 1800px) 100vw, 1800px\" \/><\/p>\n<p>By default, <strong>Docker Compose<\/strong> does not set any size limits for logs. For example, let&#8217;s set the limit to 10 MB and the maximum number of files for rotation &#8212; 10.<\/p>\n<pre class=\"brush: yaml; title: ; notranslate\" title=\"\">\r\nversion: &quot;3.8&quot;\r\nservices:\r\n  some-service:\r\n    image: some-service\r\n    logging:\r\n      driver: &quot;json-file&quot;\r\n      options:\r\n        max-size: &quot;10m&quot;\r\n        max-file: &quot;10&quot;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, Docker Compose does not set any size limits for logs. For example, let&#8217;s set the limit to 10 MB and the maximum number of files for rotation &#8212; 10. &nbsp; &nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[975],"tags":[771,773,1699,1701,1703],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/2061"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2061"}],"version-history":[{"count":2,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/2061\/revisions"}],"predecessor-version":[{"id":2064,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/2061\/revisions\/2064"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2061"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2061"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}