logging.conf 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. [loggers]
  2. keys=root,test, production
  3. [handlers]
  4. keys=rotatingFileHandler,testHandler,consoleHandler, productionHandler
  5. [formatters]
  6. keys=simpleFmt
  7. [logger_root]
  8. level=DEBUG
  9. handlers=rotatingFileHandler
  10. [logger_test]
  11. level=DEBUG
  12. handlers=testHandler
  13. qualname=test
  14. propagate=0
  15. [logger_production]
  16. level=DEBUG
  17. handlers=productionHandler
  18. qualname=production
  19. propagate=0
  20. [handler_rotatingFileHandler]
  21. class=handlers.RotatingFileHandler
  22. level=INFO
  23. formatter=simpleFmt
  24. args=("./default_log.log", "a", 20*1024*1024, 10, 'utf-8')
  25. [handler_testHandler]
  26. class=handlers.RotatingFileHandler
  27. level=INFO
  28. formatter=simpleFmt
  29. args=("./test_log.log", "a", 20*1024*1024, 10, 'utf-8')
  30. [handler_consoleHandler]
  31. class=StreamHandler
  32. level=DEBUG
  33. formatter=simpleFmt
  34. args=(sys.stdout,)
  35. [handler_productionHandler]
  36. class=handlers.RotatingFileHandler
  37. level=INFO
  38. formatter=simpleFmt
  39. args=("./log.log", "a", 20*1024*1024, 10, 'utf-8')
  40. [formatter_simpleFmt]
  41. format=%(asctime)s - %(name)s - %(levelname)s - %(message)s - [%(filename)s:%(lineno)s]