CORD-5285: Configure config files to use new logging module
Change-Id: Ia22b455c18790937fdb2be7d093951a192007ccf
diff --git a/roles/cord-profile/templates/xos_config.yaml.j2 b/roles/cord-profile/templates/xos_config.yaml.j2
index d05333c..7be1455 100644
--- a/roles/cord-profile/templates/xos_config.yaml.j2
+++ b/roles/cord-profile/templates/xos_config.yaml.j2
@@ -22,9 +22,19 @@
username: {{ xos_db_username }}
password: {{ xos_db_password }}
logging:
- level: {{ xos_logging_level }}
- channels:
-{% for channel in xos_logging_channels %}
- - {{ channel }}
-{% endfor %}
-xos_dir: {{ xos_dir }}
\ No newline at end of file
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ file:
+ class: logging.handlers.RotatingFileHandler
+ filename: /var/log/xos.log
+ maxBytes: 10485760
+ backupCount: 5
+ loggers:
+ '':
+ handlers:
+ - console
+ - file
+ level: DEBUG
+xos_dir: {{ xos_dir }}
diff --git a/roles/cord-profile/templates/xos_config_synchronizer.yaml.j2 b/roles/cord-profile/templates/xos_config_synchronizer.yaml.j2
index d3f7d2f..89c3d8c 100644
--- a/roles/cord-profile/templates/xos_config_synchronizer.yaml.j2
+++ b/roles/cord-profile/templates/xos_config_synchronizer.yaml.j2
@@ -23,11 +23,18 @@
endpoint: "xos-core.{{ site_suffix }}:50051"
logging:
- file: '/var/log/xos_synchronizer.log'
- logstash_hostport: 'cordloghost.{{ site_suffix }}:5617'
- level: {{ xos_logging_level }}
- channels:
-{% for channel in xos_logging_channels %}
- - {{ channel }}
-{% endfor %}
-
+ version: 1
+ handlers:
+ console:
+ class: logging.StreamHandler
+ file:
+ class: logging.handlers.RotatingFileHandler
+ filename: /var/log/xos.log
+ maxBytes: 10485760
+ backupCount: 5
+ loggers:
+ '':
+ handlers:
+ - console
+ - file
+ level: DEBUG