- Avoid reading
__code__
when setting a custom delivery unless it exists #387
- Add support for AWS Lambda functions via the new
bugsnag.aws_lambda_handler
decorator. See the documentation for usage instructions.
- Ensure sessions are sent at exit #371
- Avoid using deprecated
flask.__version__
attribute #365 - Ensure the session delivery queue is started regardless of
auto_capture_sessions
configuration #367
-
Remove use of deprecated
pkg_resources
module #362
-
The exception's
__notes__
field will now be sent as metadata if it exists #340 0HyperCube -
Allows changing the grouping hash when using
BugsnagHandler
via the logger methods'extra
keyword argument #334 0HyperCube -
PathLike objects are now accepted as the project path #344 0HyperCube
-
Fixes one of the fields being mistakenly replaced with
[RECURSIVE]
when encoding a list or dictionary with identical siblings but no recursion. #341 0HyperCube -
Fix the ignore class list not accounting for nested classes #342 0HyperCube
- Sub-exceptions will now be reported when an
ExceptionGroup
orBaseExceptionGroup
is passed tobugsnag.notify
. This includes support for the backports provided by theexceptiongroup
package #332 #338
-
Allow preventing an exception from being reported to Bugsnag by setting the
skip_bugsnag
attr toTrue
#325 -
Prevent duplicate events from being notified in the Django integration #326
- Apply
params_filters
to URLs in request metadata #318
- Report the entire exception chain by traversing the
__cause__
and__context__
of exceptions to provides greater context into the cause of exceptions #299 Diego Restrepo Mesa #314 - Use the
__traceback__
attribute in Python 3 exception objects to improve stacktraces for handled errors #313
Note: The use of __traceback__
for the stacktraces of handled events means that the grouping of these errors on your Bugsnag dashboard will be affected when this attribute is available: it will now show the location of the exception and not the call to notify
.
- Prevent async delivery errors from escaping their thread #303
- Fix error in ASGI middleware if the ASGI
client
is None #296
- Add support for breadcrumbs. These are short log statements that are attached to error reports to help diagnose what events led to the error. See the docs for more information. #290
- Apply filtering with
params_filters
to bytes, not just strings Matt Bachmann #267
- Fixed an issue with
ContextVar
backport for Python 3.5 and 3.6 Michael J.T. O'Kelly #254
- Fixed an issue preventing code being fetched from files in the project root but not in the PWD #246
- Fix issue where types were not packaged with the library
This is a major release which adds new features while removing previously deprecated portions of the library. For a guide to upgrading your existing codebase, see the upgrade guide.
The minimum supported Python version is now 3.5. Older versions of Python are now at end-of-life. Please upgrade.
-
Added
__all__
lists throughout to indicate the boundaries of the public interface. This may affect your integration if usingimport *
. -
Removed
Configuration.use_ssl
andConfiguration.get_endpoint()
in favor of including the protocol inConfiguration.endpoint
-
Configuration.send_environment
is nowFalse
by default. Enable it as a part of your configuration to send the full request context (if any) as a part of each event. -
Removed
bugsnag.utils.ThreadLocals
as it has been superseded by thecontextvars
API -
Removed
bugsnag.utils.merge_dicts
, an unused helper function -
Removed
bugsnag.send_sessions
- Deprecated
bugsnag.notification.Notification
in favor ofbugsnag.event.Event
to better align with Bugsnag libraries on other platforms. TheNotification
class is functionally equivalent and will be removed in a future release. Event.meta_data
has been renamed toEvent.metadata
RequestConfiguration.meta_data
has been renamed toRequestConfiguration.metadata
-
Added a
request
property toEvent
. Events created by errors which occur in the HTTP request cycle (when using the integrations for Django, Flask, WSGI, or Tornado) will have the request object available. The request object can be used to add custom information to the Event which will be sent to Bugsnag. The request object itself is not serialized. -
Added type signatures throughout the library
-
[WSGI] Use
X-Forwarded-For
header if present to determine the IP address used as the default user ID. The remote address remains available in the request metadata attached to the event. Wolfgang Schnerring #133
- Support reporting exceptions thrown from threads using
threading.excepthook
#218 - [Django] Capture errors which occur outside of the request/response middleware chain, like uncaught exceptions within 404 or 500 handlers. #221
-
Support forcing an individual event to be sent synchronously to Bugsnag. Given a configuration where asynchronous=True (the default setting), use
notify(ex, asynchronous=False)
to block until the event is delivered. #207 -
Support configuring app type, which is a searchable field on the Bugsnag dashboard. Set
Configuration.app_type
to add atype
property to the app metadata of an event. #212 -
Support disabling automatic attachment of the request environment to events. Set
Configuration.send_environment
toFalse
to remove the metadata. #214 -
[ASGI] Collect request enviroment in an "environment" metadata section #214
-
Warn for incorrectly typed configuration options #211
-
Warn if running under uWSGI without thread support #215
-
Fix missing reports from failed celery tasks when the worker would terminate prior to the event being sent to bugsnag #207
-
[Django] Fix missing event context when a route did not have a name. Routes without names will now use the namespace-qualified view function name. #210
-
Ensure session counts on events do not increment with future events by copying the session information into each event #201
-
Fix erroneously delivered sessions when session tracking is disabled by release stages #202
-
Enable session tracking by default. This feature powers stability metrics on the Bugsnag dashboard. #194
-
Support reporting events from ASGI-based web servers and frameworks. See the documentation for more information about getting started. #195
-
[Django, Tornado] Add parsed JSON body content to events for requests with JSON content types. The body content can be filtered on the Bugsnag dashboard #192
- Fix diagnostic data being swapped between contexts and attached to an
unrelated Bugsnag event when using
asyncio
features #199
- WSGI middleware will no longer raise when given a badly encoded URL #188
- Add Python version string to report and session payloads (device.runtimeVersions) #179
- Ensure nested dicts are not truncated prematurely when checking for recursion due to over-aggressive object id matching #181
- Ensure
request
tab is attached to Flask requests when JSON data is malformed or otherwise cannot be read at crash time #176
-
Ensure metadata keys are safely stringified before serialization Brock Haywood #163
-
Remove non-essential packages from distribution #173
- Separate middleware stacks, ensuring Bugsnag middleware is always run before user-added middleware, giving user callbacks full control over captured data. #166
-
Speed up SanitizingJSONEncoder on large objects #148 Jon Lund Steffensen
-
Add django.http.response.Http404 to default ignore_classes #159 Bruno Alla
-
Remove dependency on dist_utils for modern python versions #161 Chris Kuehl
-
Fix cases where parts of a payload could be erroneously trimmed as a recursive value #147
-
Apply payload filters to device and user metadata #146
-
Ensure correct usage of
is_authenticated
in Django applications #143 -
Allow
exception
option to override a logged exception in handler callbacks #141
- Add support for tracking sessions and overall crash rate by setting
auto_capture_sessions
in configuration options Alex Moinet #135
- Track difference between handled and unhandled exceptions #127
-
Added flask example app #122
-
Added example for using celery with django #124
-
Added issue template #125
- Fixed context being overridden in flask notifier #123
-
Fix possible stack overflow when using a log handler and not specifying an API key #120
-
Fix
traceback_excludes_modules
when using compiled Python modules Kobi Meirson #119
- Show request method for Django apps Kyle Fuller #115
This is a major release adding a number of new features and deprecating some lesser used parts of the library.
-
Add compatibility with Django 1.10 Jonny Pickett #108
-
Support customizing delivery and sending error reports using requests.
The new
Delivery
class is a generic way of sending a serialized payload to Bugsnag. TheConfiguration
class now has adelivery
property which should be an instance ofDelivery
. By default, if requests is installed, reports are sent viabugsnag.delivery.RequestsDelivery
rather thanbugsnag.delivery.UrllibDelivery
.To enforce using urllib2/urllib3, use
UrllibDelivery
:from bugsnag.delivery import UrllibDelivery bugsnag.configure(delivery=UrllibDelivery())
To use a custom
Delivery
:from bugsnag.delivery import Delivery class SomeSpecialDelivery(Delivery): def deliver(self, config, payload): send_to_my_queue(config.get_endpoint(), config.proxy_host, payload) bugsnag.configure(delivery=SomeSpecialDelivery())
-
Support multiple clients in a single environment using
bugsnag.Client
. A new client can be initialized using aConfiguration
or options passed toClient()
. By default, a client is installed as the system exception hook. To disable this behavior, setinstall_sys_hook
toFalse
.client = Client(api_key='...')
config = Configuration(api_key='...') client = Client(config)
-
Support running a block of code within a client's context. Any exception raised will be reported.
with client.capture(): raise Exception('an exception reported to Bugsnag then reraised')
Specific types of exceptions can be captured by adding
exceptions
as a tuple.with client.capture((TypeError,)): raise Exception('an exception which does not get captured')
Additional options can be passed to th resulting error report, such as attached metadata or severity.
with client.capture(account_id='123', severity='info'): raise Exception('failed to validate record')
Functions can be decorated to capture any exceptions thrown during execution.
@client.capture def foo(): raise Exception('an exception passed to Bugsnag then reraised') @client.capture((TypeError,)) def bar(): raise Exception('an exception which does not get captured') @client.capture(test_slice='B') def baz(): raise Exception('an exception passed to Bugsnag then reraised')
-
Support creating a log handler from a client, and forwarding logged messages to Bugsnag.
client = Client(api_key='...') logger = logging.getLogger(__name__) logger.addHandler(client.log_handler())
Log messages can also be customized using additional information from the log record and callbacks:
client = Client(api_key='...') logger = logging.getLogger(__name__) handler = client.log_handler() def add_extra_info(record, options): if 'meta_data' not in options: options['meta_data'] = {} options['meta_data']['stats'] = { 'account_id': record.account_id, 'ab_test_slice': record.slice_name } handler.add_callback(add_extra_info) logger.addHandler(handler)
BugsnagHandler
argumentapi_key
was deprecated as a part of this change. -
Replace existing logging with a logger. Logs from bugsnag can now be controlled by setting the log level of
logging.getLogger('bugsnag')
. Kyle Fuller #95 -
Wrap non-Exception objects passed to
notify()
in aRuntimeError
Delisa Mason #98
-
Fix proxy configuration setting a global opener Kyle Fuller #97
-
Fix dropped reports during fatal errors occuring before threads join Delisa Mason #99
-
Fix missing error reports when invoking a function decorated with a Bugsnag client using the wrong arguments Delisa Mason #110
- Log exception message when notifications fail to send
- Improve recursion handling in metadata parsing
- Fix setting
api_key
andgrouping_hash
fromnotify()
orbefore_notify()
- Fix merge behavior when overriding metadata from
notify()
- Add support for proxied connections to Bugsnag Tomas Edwardsson #79
-
Fix an issue where the package version is marked as "unknown" Kyle Fuller #83
-
Fix an issue where request metadata is not sent when not using SessionMiddleware in Django
-
Add synchronous upload mode Tuomas Peippo #67 #71
-
Add stacktraces to middleware exception logging Delisa Mason #77
-
Remove cookie logging from WSGI and Flask configurations Delisa Mason
-
Remove use of deprecated
request.REQUEST
attribute in favor ofGET
/POST
Delisa Mason #69 -
Fix user attribute logging for Django custom authentication setups Delisa Mason #76 #78
- Redact HTTP_COOKIE and HTTP_AUTHORIZATION by default
- Add add_metadata_tab method
- Fix Flask integration overriding user information
- Optionally send a snippet of code along with each frame in the stacktrace
- Default to https:// for reports.
- Allow custom meta-data when using the Bugsnag log handler (thanks @lwcolton!)
- Update flask support for python 3.4 (thanks @stas!)
- Show json post body for flask requests (thanks @stas!)
- Better logging support
- More robustness for notifies during shutdown
- Call close() on WSGI apps that are only iterable, not iterators
- Now works on Python 3.2
- Read request-local settings in bugsnag.notify
- Add support for before_notify callbacks
- Avoid truncating values when unnecessary
- Send user data to bugsnag for django
- Send 'severity' of error to Bugsnag
- Add 'payloadVersion'
- Make params_filter configuration work
- Allow custom groupingHash
- Send hostname to Bugsnag
- Added celery integration
- Configure the log handler in the constructor for when called from cron job.
- Read the API key from the environment for Heroku users
- Best guess a project_root for a sensible default
- Add blinker as a dependency, makes using Bugsnag with Flask easier
- Removed automatic userId population from username in django, to avoid a database lookup
- Fix cookies bug in Tornado apps
- Added support for Tornado apps
- Additional protection for bad string encodings
- Fixed issue when non-unicode data was passed in metadata
- Filters are now applied for substring matches ("password" will now also match "confirm_password")
- Ignore django.http.Http404 exceptions by default when using django middleware
- Log trace when HTTP exception
- Log the trace when theres an exception notifying