Merge "Add general logging conf"
diff --git a/neutron/files/mitaka/neutron-generic.conf b/neutron/files/mitaka/neutron-generic.conf
index 6358414..013b609 100644
--- a/neutron/files/mitaka/neutron-generic.conf
+++ b/neutron/files/mitaka/neutron-generic.conf
@@ -376,6 +376,9 @@
 # example, logging_context_format_string). (string value)
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if neutron.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/files/mitaka/neutron-server.conf b/neutron/files/mitaka/neutron-server.conf
index d676791..6bfbe6a 100644
--- a/neutron/files/mitaka/neutron-server.conf
+++ b/neutron/files/mitaka/neutron-server.conf
@@ -411,6 +411,9 @@
 # example, logging_context_format_string). (string value)
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if server.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/files/newton/neutron-generic.conf b/neutron/files/newton/neutron-generic.conf
index 5144b71..bdb0c0a 100644
--- a/neutron/files/newton/neutron-generic.conf
+++ b/neutron/files/newton/neutron-generic.conf
@@ -376,6 +376,9 @@
 # example, logging_context_format_string). (string value)
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if neutron.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/files/newton/neutron-server.conf b/neutron/files/newton/neutron-server.conf
index cf54c3e..0c89ab8 100644
--- a/neutron/files/newton/neutron-server.conf
+++ b/neutron/files/newton/neutron-server.conf
@@ -410,6 +410,9 @@
 # example, logging_context_format_string). (string value)
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if server.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/files/ocata/neutron-generic.conf b/neutron/files/ocata/neutron-generic.conf
index a5d66df..8b0492b 100644
--- a/neutron/files/ocata/neutron-generic.conf
+++ b/neutron/files/ocata/neutron-generic.conf
@@ -326,6 +326,9 @@
 # Note: This option can be changed without restarting.
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if neutron.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/files/ocata/neutron-server.conf b/neutron/files/ocata/neutron-server.conf
index 0875697..6700549 100644
--- a/neutron/files/ocata/neutron-server.conf
+++ b/neutron/files/ocata/neutron-server.conf
@@ -370,6 +370,9 @@
 # Note: This option can be changed without restarting.
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if server.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/files/pike/neutron-generic.conf b/neutron/files/pike/neutron-generic.conf
index 57cedea..9384076 100644
--- a/neutron/files/pike/neutron-generic.conf
+++ b/neutron/files/pike/neutron-generic.conf
@@ -326,6 +326,9 @@
 # Note: This option can be changed without restarting.
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if neutron.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/files/pike/neutron-server.conf b/neutron/files/pike/neutron-server.conf
index 1fb1781..b91c122 100644
--- a/neutron/files/pike/neutron-server.conf
+++ b/neutron/files/pike/neutron-server.conf
@@ -386,6 +386,9 @@
 # Note: This option can be changed without restarting.
 # Deprecated group/name - [DEFAULT]/log_config
 #log_config_append = <None>
+{%- if server.logging.log_appender %}
+log_config_append = /etc/neutron/logging.conf
+{%- endif %}
 
 # Defines the format string for %%(asctime)s in log records. Default:
 # %(default)s . This option is ignored if log_config_append is set. (string
diff --git a/neutron/server.sls b/neutron/server.sls
index d012907..65b98bd 100644
--- a/neutron/server.sls
+++ b/neutron/server.sls
@@ -157,6 +157,27 @@
     - name: python-fluent-logger
 {%- endif %}
 
+neutron_general_logging_conf:
+  file.managed:
+    - name: /etc/neutron/logging.conf
+    - source: salt://oslo_templates/files/logging/_logging.conf
+    - template: jinja
+    - makedirs: True
+    - defaults:
+        service_name: neutron
+        _data: {{ server.logging }}
+    - user: neutron
+    - group: neutron
+    - require_in:
+      - sls: neutron.db.offline_sync
+    - require:
+      - pkg: neutron_server_packages
+{%- if server.logging.log_handlers.get('fluentd', {}).get('enabled', False) %}
+      - pkg: neutron_server_fluentd_logger_package
+{%- endif %}
+    - watch_in:
+      - service: neutron_server_services
+
 {%- for service_name in server.services %}
 {{ service_name }}_logging_conf:
   file.managed: