version: 1
formatters:
  debug:
    format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
  message:
    format: '%(message)s'

filters:
  stderr_filter:
    (): logger_setup.StderrFilter

handlers:
  console-debug:
    class: logging.StreamHandler
    level: DEBUG
    formatter: debug
    stream: ext://sys.stdout

  console-info:
    class: logging.StreamHandler
    level: INFO
    formatter: message
    stream: ext://sys.stdout

  console-warning:
    class: logging.StreamHandler
    level: WARNING
    filters: [stderr_filter]
    formatter: message
    stream: ext://sys.stderr

  debug_file_handler:
    class: logging.handlers.RotatingFileHandler
    level: DEBUG
    formatter: debug
    filename: debug.log
    maxBytes: 10485760 # 10MB
    backupCount: 20
    encoding: utf8

root:
  level: INFO
  handlers: [console-info, console-warning, debug_file_handler]
