From 56a31cb1146a8c016e57d35dc10f04e1beadb04b Mon Sep 17 00:00:00 2001
From: Ian Wienand <iwienand@redhat.com>
Date: Thu, 11 Feb 2021 10:51:30 +1100
Subject: [PATCH] refstack: capture container logs to disk

We have setup rsyslogd/logrotate to handle anything with docker- tags
to be persisted to disk in /var/log/containers.  Set this up here so
we keep track of the mariadb and refstack logs.

Change-Id: I760cfeb7226f79986fbf9d7dbc5f899fc87a0cd1
---
 .../roles/refstack/templates/docker-compose.yaml.j2      | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/playbooks/roles/refstack/templates/docker-compose.yaml.j2 b/playbooks/roles/refstack/templates/docker-compose.yaml.j2
index 7b95dee49e..9269eafc85 100644
--- a/playbooks/roles/refstack/templates/docker-compose.yaml.j2
+++ b/playbooks/roles/refstack/templates/docker-compose.yaml.j2
@@ -14,6 +14,11 @@ services:
       MYSQL_PASSWORD: "{{ refstack_db_password }}"
     volumes:
       - /var/lib/refstack/db:/var/lib/mysql
+    logging:
+      driver: syslog
+      options:
+        tag: "docker-mariadb"
+
   refstack-api:
     depends_on:
       - mariadb
@@ -24,3 +29,7 @@ services:
       - /var/lib/refstack/etc/refstack.conf:/etc/refstack.conf
       - /var/lib/refstack/etc/config.json:/refstack-ui/app/config.json
       - /var/lib/refstack/data:/var/run/data
+    logging:
+      driver: syslog
+      options:
+        tag: "docker-refstack-api"