BugsRadar

The logging module

Updated 1 October 2026 · BugsRadar team

init connects BugsRadar to the standard logging module: records at ERROR and above go to your channels from every logger, whatever handlers your logging setup has. It adds no handlers, so your logging setup works as before.

Install the package and call init first: see Install and Set it up. The API key is secret: where it may go.

Records at ERROR and above

orders.py
import logging

logger = logging.getLogger(__name__)

try:
    create_order(order_id)
except Exception:
    logger.exception("Order %s failed", order_id)

Templates and grouping

logger.exception and exc_info=True bring the exception with its traceback. The format string Order %s failed becomes the message template, so failures of different orders are one error with a count, not a message each.

What the message looks like in the chat, how repeats are counted and when errors are bundled: see What you receive.

Other levels and handlers

Choose another level with logging_level=logging.WARNING. To leave logging alone, pass logging_level=None and add bugsradar.LoggingHandler() to the loggers you choose.

Next: loguru sink →