1
0

log.config 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. version: 1
  2. formatters:
  3. precise:
  4. {% if worker_name %}
  5. format: '%(asctime)s - worker:{{ worker_name }} - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
  6. {% else %}
  7. format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s - %(message)s'
  8. {% endif %}
  9. handlers:
  10. file:
  11. class: logging.handlers.TimedRotatingFileHandler
  12. formatter: precise
  13. filename: {{ LOG_FILE_PATH or "homeserver.log" }}
  14. when: "midnight"
  15. backupCount: 6 # Does not include the current log file.
  16. encoding: utf8
  17. # Default to buffering writes to log file for efficiency. This means that
  18. # there will be a delay for INFO/DEBUG logs to get written, but WARNING/ERROR
  19. # logs will still be flushed immediately.
  20. buffer:
  21. class: logging.handlers.MemoryHandler
  22. target: file
  23. # The capacity is the number of log lines that are buffered before
  24. # being written to disk. Increasing this will lead to better
  25. # performance, at the expensive of it taking longer for log lines to
  26. # be written to disk.
  27. capacity: 10
  28. flushLevel: 30 # Flush for WARNING logs as well
  29. console:
  30. class: logging.StreamHandler
  31. formatter: precise
  32. loggers:
  33. synapse.storage.SQL:
  34. # beware: increasing this to DEBUG will make synapse log sensitive
  35. # information such as access tokens.
  36. level: INFO
  37. root:
  38. level: {{ SYNAPSE_LOG_LEVEL or "INFO" }}
  39. {% if LOG_FILE_PATH %}
  40. handlers: [console, buffer]
  41. {% else %}
  42. handlers: [console]
  43. {% endif %}
  44. disable_existing_loggers: false