diff --git a/bundles/matrix-synapse/files/log.yaml b/bundles/matrix-synapse/files/log.yaml new file mode 100644 index 0000000..f2bc9ff --- /dev/null +++ b/bundles/matrix-synapse/files/log.yaml @@ -0,0 +1,21 @@ +version: 1 + +formatters: + journal: + format: '%(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s' + +handlers: + console: + class: logging.StreamHandler + formatter: journal + +loggers: + synapse.storage.SQL: + level: INFO + +root: + level: INFO + + handlers: [console] + +disable_existing_loggers: false diff --git a/bundles/matrix-synapse/items.py b/bundles/matrix-synapse/items.py index 172a940..527cc5e 100644 --- a/bundles/matrix-synapse/items.py +++ b/bundles/matrix-synapse/items.py @@ -1,7 +1,15 @@ files = { '/etc/matrix-synapse/homeserver.yaml': { 'content_type': 'mako', - 'context': node.metadata['matrix-synapse'], + 'context': node.metadata.get('matrix-synapse'), + 'needs': { + 'pkg_apt:matrix-synapse-py3', + }, + 'triggers': { + 'svc_systemd:matrix-synapse:restart', + }, + }, + '/etc/matrix-synapse/log.yaml': { 'needs': { 'pkg_apt:matrix-synapse-py3', }, @@ -31,7 +39,7 @@ files = { # Our override.conf ensures this file is never read, so we don't # need to restart synapse after changing stuff in here. 'content_type': 'mako', - 'context': node.metadata['matrix-synapse'], + 'context': node.metadata.get('matrix-synapse'), }, '/etc/matrix-synapse/conf.d/report_stats.yaml': { # see comment above @@ -42,6 +50,7 @@ svc_systemd = { 'matrix-synapse': { 'needs': { 'file:/etc/matrix-synapse/homeserver.yaml', + 'file:/etc/matrix-synapse/log.yaml', 'file:/etc/systemd/system/matrix-synapse.service.d/override.conf', 'pkg_apt:matrix-synapse-py3', 'postgres_db:synapse',