{"id":839,"date":"2022-03-31T19:18:19","date_gmt":"2022-03-31T19:18:19","guid":{"rendered":"https:\/\/www.ebnet.us\/?p=839"},"modified":"2022-04-30T23:16:01","modified_gmt":"2022-05-01T03:16:01","slug":"how-to-rotate-the-traefik-access-log-in-docker-swarm","status":"publish","type":"post","link":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/","title":{"rendered":"How to rotate the Traefik access.log in Docker Swarm"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I enabled <a href=\"https:\/\/traefik.io\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Traefik<\/strong><\/a> access logs to use in <strong><a href=\"https:\/\/grafana.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Grafana<\/a><\/strong> for a Traefik to <strong><a href=\"https:\/\/grafana.com\/oss\/loki\/\" target=\"_blank\" rel=\"noreferrer noopener\">Loki<\/a><\/strong> dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon to find and a send a USR1 signal to the container. If we do not send a USR1 signal the container will stop logging when the log is rotated. While this post is focused on Traefik, the same principles should work for any container running as a Docker service writing logs to the host \/var\/log directory.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"533\" src=\"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Via-Loki-Dashboard-1024x533.png\" alt=\"Traefik-Via-Loki-Dashboard\" class=\"wp-image-842\" srcset=\"https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Via-Loki-Dashboard-1024x533.png 1024w, https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Via-Loki-Dashboard-300x156.png 300w, https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Via-Loki-Dashboard-768x400.png 768w, https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Via-Loki-Dashboard-1536x800.png 1536w, https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Via-Loki-Dashboard.png 1803w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Grafana Traefik Via Loki Dashboard<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Logrotate Definition for Traefik access.log<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\/var\/log\/traefik\/access.log {\n\tdaily\n\tcompress\n\tdelaycompress\n\tpostrotate\n\tdocker kill --signal=\"USR1\" $(docker ps | grep traefik | awk '{print $1}')\n\tendscript\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The important line is the post command <strong>&#8220;docker kill &#8211;signal=&#8221;USR1&#8243; $(docker ps | grep traefik | awk &#8216;{print $1}&#8217;)&#8221;<\/strong> which will find your container by its service name and send the needed USR1 signal<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":843,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[12,28,25,27],"tags":[9,10,26],"class_list":["post-839","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","category-linux","category-software","category-traefik","tag-docker","tag-dockerswarm","tag-traefik"],"featured_image_src":"https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Logo.webp","author_info":{"display_name":"Ed Brandon","author_link":"https:\/\/www.ebnet.us\/index.php\/author\/bigeb\/"},"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Ed Brandon\"\/>\n\t<meta name=\"google-site-verification\" content=\"google3df54d40fcd428c7\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"EBnet - Tech Everything from Raspberry Pi&#039;s to Playstation 5\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How to rotate the Traefik access.log in Docker Swarm - EBnet\" \/>\n\t\t<meta property=\"og:description\" content=\"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2021\/12\/1881b614309840f89a43c31f57c34eb9.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2021\/12\/1881b614309840f89a43c31f57c34eb9.png\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-03-31T19:18:19+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-05-01T03:16:01+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@EBnetBlog\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to rotate the Traefik access.log in Docker Swarm - EBnet\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@EBnetBlog\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Logo.webp\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Ed Brandon\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#blogposting\",\"name\":\"How to rotate the Traefik access.log in Docker Swarm - EBnet\",\"headline\":\"How to rotate the Traefik access.log in Docker Swarm\",\"author\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/author\\\/bigeb\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ebnet.us\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Traefik-Logo.webp\",\"width\":500,\"height\":280,\"caption\":\"Traefik Logo\"},\"datePublished\":\"2022-03-31T19:18:19-04:00\",\"dateModified\":\"2022-04-30T23:16:01-04:00\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#webpage\"},\"articleSection\":\"Docker, Linux, Software, Traefik, Docker, Docker Swarm, Traefik\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.ebnet.us\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/#listItem\",\"position\":2,\"name\":\"Software\",\"item\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/docker\\\/#listItem\",\"name\":\"Docker\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/docker\\\/#listItem\",\"position\":3,\"name\":\"Docker\",\"item\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/docker\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#listItem\",\"name\":\"How to rotate the Traefik access.log in Docker Swarm\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#listItem\",\"position\":4,\"name\":\"How to rotate the Traefik access.log in Docker Swarm\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/category\\\/software\\\/docker\\\/#listItem\",\"name\":\"Docker\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/#person\",\"name\":\"Ed Brandon\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/20d736232d61bbd38f16ad2bd010efbb7fa62d271bfd4dcf054ba0fe5b36a63a?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Ed Brandon\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/EBnetBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/author\\\/bigeb\\\/#author\",\"url\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/author\\\/bigeb\\\/\",\"name\":\"Ed Brandon\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/20d736232d61bbd38f16ad2bd010efbb7fa62d271bfd4dcf054ba0fe5b36a63a?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Ed Brandon\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/EBnetBlog\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#webpage\",\"url\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/\",\"name\":\"How to rotate the Traefik access.log in Docker Swarm - EBnet\",\"description\":\"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/author\\\/bigeb\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/author\\\/bigeb\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.ebnet.us\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/Traefik-Logo.webp\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#mainImage\",\"width\":500,\"height\":280,\"caption\":\"Traefik Logo\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/index.php\\\/2022\\\/03\\\/31\\\/how-to-rotate-the-traefik-access-log-in-docker-swarm\\\/#mainImage\"},\"datePublished\":\"2022-03-31T19:18:19-04:00\",\"dateModified\":\"2022-04-30T23:16:01-04:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/#website\",\"url\":\"https:\\\/\\\/www.ebnet.us\\\/\",\"name\":\"EBnet\",\"description\":\"Tech Everything from Raspberry Pi's to Playstation 5\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.ebnet.us\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to rotate the Traefik access.log in Docker Swarm - EBnet","description":"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon","canonical_url":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"google3df54d40fcd428c7","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#blogposting","name":"How to rotate the Traefik access.log in Docker Swarm - EBnet","headline":"How to rotate the Traefik access.log in Docker Swarm","author":{"@id":"https:\/\/www.ebnet.us\/index.php\/author\/bigeb\/#author"},"publisher":{"@id":"https:\/\/www.ebnet.us\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Logo.webp","width":500,"height":280,"caption":"Traefik Logo"},"datePublished":"2022-03-31T19:18:19-04:00","dateModified":"2022-04-30T23:16:01-04:00","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#webpage"},"isPartOf":{"@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#webpage"},"articleSection":"Docker, Linux, Software, Traefik, Docker, Docker Swarm, Traefik"},{"@type":"BreadcrumbList","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.ebnet.us#listItem","position":1,"name":"Home","item":"https:\/\/www.ebnet.us","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/category\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/category\/software\/#listItem","position":2,"name":"Software","item":"https:\/\/www.ebnet.us\/index.php\/category\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/category\/software\/docker\/#listItem","name":"Docker"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.ebnet.us#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/category\/software\/docker\/#listItem","position":3,"name":"Docker","item":"https:\/\/www.ebnet.us\/index.php\/category\/software\/docker\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#listItem","name":"How to rotate the Traefik access.log in Docker Swarm"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/category\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#listItem","position":4,"name":"How to rotate the Traefik access.log in Docker Swarm","previousItem":{"@type":"ListItem","@id":"https:\/\/www.ebnet.us\/index.php\/category\/software\/docker\/#listItem","name":"Docker"}}]},{"@type":"Person","@id":"https:\/\/www.ebnet.us\/#person","name":"Ed Brandon","image":{"@type":"ImageObject","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/20d736232d61bbd38f16ad2bd010efbb7fa62d271bfd4dcf054ba0fe5b36a63a?s=96&d=mm&r=g","width":96,"height":96,"caption":"Ed Brandon"},"sameAs":["https:\/\/twitter.com\/EBnetBlog"]},{"@type":"Person","@id":"https:\/\/www.ebnet.us\/index.php\/author\/bigeb\/#author","url":"https:\/\/www.ebnet.us\/index.php\/author\/bigeb\/","name":"Ed Brandon","image":{"@type":"ImageObject","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/20d736232d61bbd38f16ad2bd010efbb7fa62d271bfd4dcf054ba0fe5b36a63a?s=96&d=mm&r=g","width":96,"height":96,"caption":"Ed Brandon"},"sameAs":["https:\/\/twitter.com\/EBnetBlog"]},{"@type":"WebPage","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#webpage","url":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/","name":"How to rotate the Traefik access.log in Docker Swarm - EBnet","description":"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.ebnet.us\/#website"},"breadcrumb":{"@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#breadcrumblist"},"author":{"@id":"https:\/\/www.ebnet.us\/index.php\/author\/bigeb\/#author"},"creator":{"@id":"https:\/\/www.ebnet.us\/index.php\/author\/bigeb\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Logo.webp","@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#mainImage","width":500,"height":280,"caption":"Traefik Logo"},"primaryImageOfPage":{"@id":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/#mainImage"},"datePublished":"2022-03-31T19:18:19-04:00","dateModified":"2022-04-30T23:16:01-04:00"},{"@type":"WebSite","@id":"https:\/\/www.ebnet.us\/#website","url":"https:\/\/www.ebnet.us\/","name":"EBnet","description":"Tech Everything from Raspberry Pi's to Playstation 5","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.ebnet.us\/#person"}}]},"og:locale":"en_US","og:site_name":"EBnet - Tech Everything from Raspberry Pi's to Playstation 5","og:type":"article","og:title":"How to rotate the Traefik access.log in Docker Swarm - EBnet","og:description":"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon","og:url":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/","og:image":"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2021\/12\/1881b614309840f89a43c31f57c34eb9.png","og:image:secure_url":"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2021\/12\/1881b614309840f89a43c31f57c34eb9.png","article:published_time":"2022-03-31T19:18:19+00:00","article:modified_time":"2022-05-01T03:16:01+00:00","twitter:card":"summary_large_image","twitter:site":"@EBnetBlog","twitter:title":"How to rotate the Traefik access.log in Docker Swarm - EBnet","twitter:description":"I enabled Traefik access logs to use in Grafana for a Traefik to Loki dashboard. I quickly found out Traefik access logs grow quickly and I would need to rotate the Traefik access.log in Docker Swarm. Since I have Traefik running in a container in Docker Swarm we will have to tell the logrotate daemon","twitter:creator":"@EBnetBlog","twitter:image":"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Logo.webp","twitter:label1":"Written by","twitter:data1":"Ed Brandon","twitter:label2":"Est. reading time","twitter:data2":"1 minute"},"aioseo_meta_data":{"post_id":"839","title":"#post_title #separator_sa #site_title","description":"#post_excerpt","keywords":[],"keyphrases":{"focus":{"keyphrase":"rotate the Traefik access.log in Docker ","score":75,"analysis":{"keyphraseInTitle":{"title":"Focus keyphrase in SEO title","description":"Focus keyphrase found in SEO title.","score":9,"maxScore":9,"error":0},"keyphraseInDescription":{"title":"Focus keyphrase in meta description","description":"Focus keyphrase found in meta description.","score":9,"maxScore":9,"error":0},"keyphraseLength":{"title":"Focus keyphrase length","description":"Focus keyphrase is slightly long. Try to make it shorter.","score":6,"maxScore":9,"error":1,"length":6},"keyphraseInURL":{"title":"Focus keyphrase in URL","description":"Focus keyphrase used in the URL.","score":5,"maxScore":5,"error":0},"keyphraseInIntroduction":{"title":"Focus keyphrase in introduction","description":"Your Focus keyphrase appears in the first paragraph. Well done!","score":9,"maxScore":9,"error":0},"keyphraseInSubHeadings":{"title":"Focus keyphrase in Subheadings","description":"Use your focus keyphrase more in your H2 and H3 subheadings.","score":3,"maxScore":9,"error":1},"keyphraseInImageAlt":{"title":"Focus keyphrase in image alt attributes","description":"Focus keyphrase not found in image alt attribute(s). Add an image with your Focus keyphrase as alt text.","score":3,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"summary_large_image","twitter_image_type":"featured","twitter_image_url":"https:\/\/ebnet.local.ebnet.us\/wp-content\/uploads\/2022\/03\/Traefik-Logo.webp","twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"Article","defaultPostTypeGraph":""},"schema_type":"default","schema_type_options":"{\"article\":{\"articleType\":\"BlogPosting\"},\"course\":{\"name\":\"\",\"description\":\"\",\"provider\":\"\"},\"faq\":{\"pages\":[]},\"product\":{\"reviews\":[]},\"recipe\":{\"ingredients\":[],\"instructions\":[],\"keywords\":[]},\"software\":{\"reviews\":[],\"operatingSystems\":[]},\"webPage\":{\"webPageType\":\"WebPage\"}}","pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2022-03-31 19:16:57","updated":"2025-10-01 03:14:19","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ebnet.us\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ebnet.us\/index.php\/category\/software\/\" title=\"Software\">Software<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.ebnet.us\/index.php\/category\/software\/docker\/\" title=\"Docker\">Docker<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to rotate the Traefik access.log in Docker Swarm\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.ebnet.us"},{"label":"Software","link":"https:\/\/www.ebnet.us\/index.php\/category\/software\/"},{"label":"Docker","link":"https:\/\/www.ebnet.us\/index.php\/category\/software\/docker\/"},{"label":"How to rotate the Traefik access.log in Docker Swarm","link":"https:\/\/www.ebnet.us\/index.php\/2022\/03\/31\/how-to-rotate-the-traefik-access-log-in-docker-swarm\/"}],"_links":{"self":[{"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/posts\/839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/comments?post=839"}],"version-history":[{"count":1,"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/posts\/839\/revisions"}],"predecessor-version":[{"id":934,"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/posts\/839\/revisions\/934"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/media\/843"}],"wp:attachment":[{"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/media?parent=839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/categories?post=839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ebnet.us\/index.php\/wp-json\/wp\/v2\/tags?post=839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}