logging_config.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. version: 1
  2. disable_existing_loggers: False
  3. formatters:
  4. simple:
  5. format: "%(asctime)s - [%(filename)s:%(lineno)s-%(funcName)s()] - %(levelname)s - %(message)s"
  6. handlers:
  7. console:
  8. class: logging.StreamHandler
  9. level: INFO
  10. formatter: simple
  11. stream: ext://sys.stdout
  12. info_file_handler:
  13. class: logging.handlers.RotatingFileHandler
  14. level: DEBUG
  15. formatter: simple
  16. filename: logs/info.log
  17. maxBytes: 30485760 # 30MB
  18. backupCount: 20
  19. encoding: utf8
  20. time_file_handler:
  21. class: logging.handlers.TimedRotatingFileHandler
  22. level: DEBUG
  23. formatter: simple
  24. filename: logs/info.log
  25. backupCount: 20000
  26. when: midnight
  27. encoding: utf8
  28. error_file_handler:
  29. class: logging.handlers.RotatingFileHandler
  30. level: ERROR
  31. formatter: simple
  32. filename: logs/errors.log
  33. maxBytes: 10485760 # 10MB
  34. backupCount: 20
  35. encoding: utf8
  36. loggers:
  37. TEST:
  38. level: DEBUG
  39. handlers: [console]
  40. propagate: no
  41. root:
  42. level: DEBUG
  43. handlers: [console, info_file_handler, error_file_handler]