From cacff1c11a233dc2f8f5780f8dd7442d86929c85 Mon Sep 17 00:00:00 2001
From: Michal Jastrzebski <inc007@gmail.com>
Date: Fri, 25 Sep 2015 17:12:55 +0200
Subject: [PATCH] Murano logging to rsyslog

Configure murano to use rsyslog container as logging mechanism

Change-Id: I98416f4dac7176539576e865c249adca04379251
Implements: bp logging-container
---
 ansible/roles/common/templates/rsyslog.conf.j2 | 6 ++++++
 ansible/roles/murano/tasks/start.yml           | 8 ++++++--
 ansible/roles/murano/templates/murano.conf.j2  | 3 +++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ansible/roles/common/templates/rsyslog.conf.j2 b/ansible/roles/common/templates/rsyslog.conf.j2
index a789bff243..86d8298b95 100755
--- a/ansible/roles/common/templates/rsyslog.conf.j2
+++ b/ansible/roles/common/templates/rsyslog.conf.j2
@@ -126,6 +126,12 @@ $template SwiftObjectExpirerFile,"/var/log/swift/swift-object-expirer.log"
 $template SwiftObjectUpdaterFile,"/var/log/swift/swift-object-updater.log"
 :syslogtag,contains,"swift-object-updater" ?SwiftObjectUpdaterFile
 
+$template MuranoEngineFile,"/var/log/murano/murano-engine.log"
+:syslogtag,contains,"murano-engine" ?MuranoEngineFile
+
+$template MuranoApiFile,"/var/log/murano/murano-api.log"
+:syslogtag,contains,"murano-api" ?MuranoApiFile
+
 $template DynFile,"/var/log/syslog.log"
 *.* ?DynFile
 & ~
diff --git a/ansible/roles/murano/tasks/start.yml b/ansible/roles/murano/tasks/start.yml
index 3ec2231700..c9f73b11e6 100644
--- a/ansible/roles/murano/tasks/start.yml
+++ b/ansible/roles/murano/tasks/start.yml
@@ -13,7 +13,9 @@
     insecure_registry: "{{ docker_insecure_registry }}"
     name: murano_engine
     image: "{{ murano_engine_image_full }}"
-    volumes: "{{ node_config_directory }}/murano-engine/:/opt/kolla/config_files/:ro"
+    volumes:
+      - "{{ node_config_directory }}/murano-engine/:/opt/kolla/config_files/:ro"
+      - "/var/lib/kolla/dev/log:/dev/log"
     volumes_from:
     env:
       KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
@@ -33,7 +35,9 @@
     insecure_registry: "{{ docker_insecure_registry }}"
     name: murano_api
     image: "{{ murano_api_image_full }}"
-    volumes: "{{ node_config_directory }}/murano-api/:/opt/kolla/config_files/:ro"
+    volumes:
+      - "{{ node_config_directory }}/murano-api/:/opt/kolla/config_files/:ro"
+      - "/var/lib/kolla/dev/log:/dev/log"
     env:
       KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
   when: inventory_hostname in groups['murano-api']
diff --git a/ansible/roles/murano/templates/murano.conf.j2 b/ansible/roles/murano/templates/murano.conf.j2
index 85b1fea64f..db4192e37f 100644
--- a/ansible/roles/murano/templates/murano.conf.j2
+++ b/ansible/roles/murano/templates/murano.conf.j2
@@ -7,6 +7,9 @@ rabbit_userid = {{ rabbitmq_user }}
 rabbit_password = {{ rabbitmq_password }}
 notification_driver = noop
 
+use_syslog = True
+syslog_log_facility = LOG_LOCAL0
+
 {% if service_name == 'murano-api' %}
 bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
 bind_port = {{ murano_api_port }}
-- 
GitLab