Bugsnag is a comprehensive error monitoring library for Python applications, including frameworks like Django, Flask, and Tornado. It automatically detects and reports unhandled exceptions, and allows for manual reporting of handled errors, providing detailed diagnostic information to a central dashboard. The library is actively maintained, currently at version 4.8.1, with regular updates to support new Python features and integrations.
pip install bugsnagVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic Bugsnag configuration and how to manually report a handled exception. Ensure `BUGSNAG_API_KEY` is set in your environment or replace the placeholder.
Upgrade Python to 3.5 or newer. Remove usage of `bugsnag.utils.ThreadLocals`. Review and update any uses of deprecated properties from 2.x which were removed in 4.x.
To send environment data, set `send_environment=True` in your configuration. Ensure all configuration properties passed to `configure()` are recognized by the library.
Replace `config.use_ssl = True` and `config.endpoint = 'my.example.com'` with `config.endpoint = 'https://my.example.com'`.
For full coverage, ensure your application runs on Python 3.8+. Alternatively, manually wrap critical thread logic with `try...except` and `bugsnag.notify()` for older Python versions.
Configure `params_filters` in `bugsnag.configure()` with a list of strings whose matching keys should be filtered from payloads. Example: `bugsnag.configure(params_filters=['password', 'credit_card_number'])`.
Avoid using `from bugsnag import *`. Instead, explicitly import only the necessary symbols (e.g., `import bugsnag` or `from bugsnag import notify`).
Ensure the bugsnag library is installed using pip: `pip install bugsnag`
Set the `api_key` configuration option with your actual Bugsnag API key, either directly in code (e.g., `bugsnag.configure(api_key='YOUR_API_KEY')`) or via the `BUGSNAG_API_KEY` environment variable.
Verify the import statement for `BugsnagHandler` is `from bugsnag.handlers import BugsnagHandler` and ensure your `bugsnag` package is up-to-date. If using an older version, consult the documentation for the correct import path.
Configure `notify_release_stages` to include the current `release_stage`, e.g., `bugsnag.configure(release_stage='development', notify_release_stages=['development', 'production'])`.