summary refs log tree commit diff
path: root/contrib/systemd/log_config.yaml
diff options
context:
space:
mode:
authorIvan Shapovalov <intelfx100@gmail.com>2015-04-29 01:20:08 +0300
committerIvan Shapovalov <intelfx100@gmail.com>2015-04-29 03:01:56 +0300
commit45278eaa19b55cab2b750d8937c4d55b4ff7c821 (patch)
tree1e5c25999ef27a700416aeb5fb2111d89265c20d /contrib/systemd/log_config.yaml
parentimprove postgres blurb a bit (diff)
downloadsynapse-45278eaa19b55cab2b750d8937c4d55b4ff7c821.tar.xz
contrib/systemd: add a sample systemd unit file and a logger configuration
The added logger configuration (--log-config or log_config:) uses
systemd's python bindings to pass messages directly to the journal.

Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
Diffstat (limited to 'contrib/systemd/log_config.yaml')
-rw-r--r--contrib/systemd/log_config.yaml23
1 files changed, 23 insertions, 0 deletions
diff --git a/contrib/systemd/log_config.yaml b/contrib/systemd/log_config.yaml
new file mode 100644
index 0000000000..e16fb5456a
--- /dev/null
+++ b/contrib/systemd/log_config.yaml
@@ -0,0 +1,23 @@
+version: 1
+
+# In systemd's journal, loglevel is implicitly stored, so let's omit it
+# from the message text.
+formatters:
+    journal_fmt:
+        format: '%(name)s: [%(request)s] %(message)s'
+
+filters:
+    context:
+        (): synapse.util.logcontext.LoggingContextFilter
+        request: ""
+
+handlers:
+    journal:
+        class: systemd.journal.JournalHandler
+        formatter: journal_fmt
+        filters: [context]
+        SYSLOG_IDENTIFIER: synapse
+
+root:
+    level: INFO
+    handlers: [journal]