---
version: 1

formatters:
  generic:
    format: '%(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s'
filters:
  rate_limit:
    (): bodhi.server.logging.RateLimiter
    rate: 3600
handlers:
  console:
    class: logging.StreamHandler
{% if env == "production" %}
    level: INFO
{% else %}
    level: DEBUG
{% endif %}
    formatter: generic
  smtp:
    class: logging.handlers.SMTPHandler
    level: ERROR
    formatter: generic
    filters: [rate_limit]
    mailhost: "bastion"
{% if env == "production" %}
    fromaddr: "updates@fedoraproject.org"
{% else %}
    fromaddr: "updates@stg.fedoraproject.org"
{% endif %}
    toaddrs:
        - "bodhiadmin-members@fedoraproject.org"
    subject: "Bodhi error"
loggers:
  bodhi:
{% if env == "production" %}
    level: INFO
{% else %}
    level: DEBUG
{% endif %}
    handlers: [console, smtp]
    propagate: 0
  root:
{% if env == "production" %}
    level: ERROR
{% else %}
    level: DEBUG
{% endif %}
    handlers: [console, smtp]
  twisted:
{% if env == "production" %}
    level: ERROR
{% else %}
    level: DEBUG
{% endif %}
    handlers: [console, smtp]
  celery:
{% if env == "production" %}
    level: INFO
{% else %}
    level: DEBUG
{% endif %}
    handlers: [console, smtp]
    propagate: 0
  celery_worker_job:
{% if env == "production" %}
    level: ERROR
{% else %}
    level: INFO
{% endif %}
    handlers: [console, smtp]
    propagate: 1
  markdown:
{% if env == "production" %}
    level: ERROR
{% else %}
    level: INFO
{% endif %}
    handlers: [console, smtp]
