uvicorn_logging.conf 671 B

1234567891011121314151617181920212223242526272829303132333435
  1. [loggers]
  2. keys=root,uvicorn
  3. [handlers]
  4. keys=console,logfile,rotating_logfile
  5. [formatters]
  6. keys=generic
  7. [logger_root]
  8. level=INFO
  9. handlers=console,logfile,rotating_logfile
  10. [logger_uvicorn]
  11. level=INFO
  12. handlers=logfile
  13. qualname=uvicorn
  14. [handler_console]
  15. class=StreamHandler
  16. args=(sys.stdout,)
  17. formatter=generic
  18. [handler_logfile]
  19. class=FileHandler
  20. args=("log/test.log",) # 1 MB per file, keep up to 10 files
  21. formatter=generic
  22. [handler_rotating_logfile]
  23. class=handlers.TimedRotatingFileHandler
  24. args=("log/test.log", "midnight", 1, 14)
  25. formatter=generic
  26. [formatter_generic]
  27. format=%(asctime)s - %(name)s - %(levelname)s - %(message)s