summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2017-02-17 14:41:48 +0000
committerGitHub <noreply@github.com>2017-02-17 14:41:48 +0000
commit2fa14fd48ad61a00adbbe0141fdcf54e2f421fb0 (patch)
tree425aca3f630757adff8c4006ef45969be0d10a2f
parentMerge pull request #1925 from matrix-org/dbkr/pushers_lang_lengthen (diff)
parentUpdate example_log_config.yaml (diff)
downloadsynapse-2fa14fd48ad61a00adbbe0141fdcf54e2f421fb0.tar.xz
Merge pull request #1926 from matrix-org/rav/example_log_config
Add an example log_config file
-rw-r--r--contrib/example_log_config.yaml48
1 files changed, 48 insertions, 0 deletions
diff --git a/contrib/example_log_config.yaml b/contrib/example_log_config.yaml
new file mode 100644
index 0000000000..7f7c8ba588
--- /dev/null
+++ b/contrib/example_log_config.yaml
@@ -0,0 +1,48 @@
+# Example log_config file for synapse. To enable, point `log_config` to it in 
+# `homeserver.yaml`, and restart synapse.
+#
+# This configuration will produce similar results to the defaults within 
+# synapse, but can be edited to give more flexibility.
+
+version: 1
+
+formatters:
+  fmt:
+    format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
+
+filters:
+  context:
+    (): synapse.util.logcontext.LoggingContextFilter
+    request: ""
+
+handlers:
+  # example output to console
+  console:
+    class: logging.StreamHandler
+    filters: [context]
+
+  # example output to file - to enable, edit 'root' config below.
+  file:
+    class: logging.handlers.RotatingFileHandler
+    formatter: fmt
+    filename: /var/log/synapse/homeserver.log
+    maxBytes: 100000000
+    backupCount: 3
+    filters: [context]
+
+
+root:
+    level: INFO
+    handlers: [console] # to use file handler instead, switch to [file]
+    
+loggers:
+    synapse:
+        level: INFO
+
+    synapse.storage:
+        level: INFO
+    
+    # example of enabling debugging for a component:
+    #
+    # synapse.federation.transport.server:
+    #    level: DEBUG