123456789101112131415161718192021222324252627282930313233343536373839404142 |
- version: 1
- disable_existing_loggers: False
- formatters:
- standard:
- format: "[%(asctime)s] [%(levelname)s] [%(name)s:%(lineno)d] - %(message)s"
- datefmt: "%Y-%m-%d %H:%M:%S"
- handlers:
- console:
- class: logging.StreamHandler
- level: INFO
- formatter: standard
- stream: ext://sys.stdout
- file:
- class: logging.handlers.RotatingFileHandler
- level: DEBUG
- formatter: standard
- filename: app/log/app.log # 相对路径,会被替换为绝对路径
- maxBytes: 10485760
- backupCount: 5
- encoding: utf8
- error_file:
- class: logging.handlers.RotatingFileHandler
- level: ERROR
- formatter: standard
- filename: app/log/errors.log # 相对路径,会被替换为绝对路径
- maxBytes: 10485760
- backupCount: 10
- encoding: utf8
- loggers:
- app:
- level: DEBUG
- handlers: [console, file, error_file]
- propagate: False
- root:
- level: DEBUG
- handlers: [console, file, error_file]
|