example_log_config.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Example log_config file for synapse. To enable, point `log_config` to it in
  2. # `homeserver.yaml`, and restart synapse.
  3. #
  4. # This configuration will produce similar results to the defaults within
  5. # synapse, but can be edited to give more flexibility.
  6. version: 1
  7. formatters:
  8. fmt:
  9. format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
  10. filters:
  11. context:
  12. (): synapse.util.logcontext.LoggingContextFilter
  13. request: ""
  14. handlers:
  15. # example output to console
  16. console:
  17. class: logging.StreamHandler
  18. formatter: fmt
  19. filters: [context]
  20. # example output to file - to enable, edit 'root' config below.
  21. file:
  22. class: logging.handlers.RotatingFileHandler
  23. formatter: fmt
  24. filename: /var/log/synapse/homeserver.log
  25. maxBytes: 100000000
  26. backupCount: 3
  27. filters: [context]
  28. encoding: utf8
  29. root:
  30. level: INFO
  31. handlers: [console] # to use file handler instead, switch to [file]
  32. loggers:
  33. synapse:
  34. level: INFO
  35. synapse.storage.SQL:
  36. # beware: increasing this to DEBUG will make synapse log sensitive
  37. # information such as access tokens.
  38. level: INFO
  39. # example of enabling debugging for a component:
  40. #
  41. # synapse.federation.transport.server:
  42. # level: DEBUG