summary refs log tree commit diff
path: root/contrib/example_log_config.yaml
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-03-13 09:59:54 +0000
committerErik Johnston <erik@matrix.org>2017-03-13 09:59:54 +0000
commit672dcf59d3f9da12da43a77e316e2eec76d3ee4c (patch)
tree9186644b06ef01e609ca018e02100ceecf0f3ea4 /contrib/example_log_config.yaml
parentMerge tag 'v0.19.3-rc1' into release-v0.19.3 (diff)
parentRevert "Support registration & login with phone number" (diff)
downloadsynapse-672dcf59d3f9da12da43a77e316e2eec76d3ee4c.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.19.3
Diffstat (limited to 'contrib/example_log_config.yaml')
-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