|
| 1 | +# Log configuration for Synapse. |
| 2 | +# |
| 3 | +# This is a YAML file containing a standard Python logging configuration |
| 4 | +# dictionary. See [1] for details on the valid settings. |
| 5 | +# |
| 6 | +# Synapse also supports structured logging for machine readable logs which can |
| 7 | +# be ingested by ELK stacks. See [2] for details. |
| 8 | +# |
| 9 | +# [1]: https://docs.python.org/3/library/logging.config.html#configuration-dictionary-schema |
| 10 | +# [2]: https://element-hq.github.io/synapse/latest/structured_logging.html |
| 11 | + |
| 12 | +version: 1 |
| 13 | + |
| 14 | +formatters: |
| 15 | + precise: |
| 16 | + format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s' |
| 17 | + |
| 18 | +handlers: |
| 19 | + # file: |
| 20 | + # class: logging.handlers.TimedRotatingFileHandler |
| 21 | + # formatter: precise |
| 22 | + # filename: /var/lib/matrix/homeserver.log |
| 23 | + # when: midnight |
| 24 | + # backupCount: 3 # Does not include the current log file. |
| 25 | + # encoding: utf8 |
| 26 | + |
| 27 | + # # Default to buffering writes to log file for efficiency. |
| 28 | + # # WARNING/ERROR logs will still be flushed immediately, but there will be a |
| 29 | + # # delay (of up to `period` seconds, or until the buffer is full with |
| 30 | + # # `capacity` messages) before INFO/DEBUG logs get written. |
| 31 | + # buffer: |
| 32 | + # class: synapse.logging.handlers.PeriodicallyFlushingMemoryHandler |
| 33 | + # target: file |
| 34 | + |
| 35 | + # # The capacity is the maximum number of log lines that are buffered |
| 36 | + # # before being written to disk. Increasing this will lead to better |
| 37 | + # # performance, at the expensive of it taking longer for log lines to |
| 38 | + # # be written to disk. |
| 39 | + # # This parameter is required. |
| 40 | + # capacity: 10 |
| 41 | + |
| 42 | + # # Logs with a level at or above the flush level will cause the buffer to |
| 43 | + # # be flushed immediately. |
| 44 | + # # Default value: 40 (ERROR) |
| 45 | + # # Other values: 50 (CRITICAL), 30 (WARNING), 20 (INFO), 10 (DEBUG) |
| 46 | + # flushLevel: 30 # Flush immediately for WARNING logs and higher |
| 47 | + |
| 48 | + # # The period of time, in seconds, between forced flushes. |
| 49 | + # # Messages will not be delayed for longer than this time. |
| 50 | + # # Default value: 5 seconds |
| 51 | + # period: 5 |
| 52 | + |
| 53 | + # A handler that writes logs to stderr. Unused by default, but can be used |
| 54 | + # instead of "buffer" and "file" in the logger handlers. |
| 55 | + console: |
| 56 | + class: logging.StreamHandler |
| 57 | + formatter: precise |
| 58 | + |
| 59 | +loggers: |
| 60 | + synapse.storage.SQL: |
| 61 | + # beware: increasing this to DEBUG will make synapse log sensitive |
| 62 | + # information such as access tokens. |
| 63 | + level: WARN |
| 64 | + |
| 65 | +root: |
| 66 | + level: WARN |
| 67 | + # Write logs to the `buffer` handler, which will buffer them together in memory, |
| 68 | + # then write them to a file. |
| 69 | + # |
| 70 | + # Replace "buffer" with "console" to log to stderr instead. |
| 71 | + # |
| 72 | + handlers: [console] |
| 73 | + |
| 74 | +disable_existing_loggers: false |
| 75 | +# vim:ft=yaml |
0 commit comments