- 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_sslandConfiguration.get_endpoint()in favor of including the protocol inConfiguration.endpoint -
Configuration.send_environmentis nowFalseby 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.ThreadLocalsas it has been superseded by thecontextvarsAPI -
Removed
bugsnag.utils.merge_dicts, an unused helper function -
Removed
bugsnag.send_sessions
- Deprecated
bugsnag.notification.Notificationin favor ofbugsnag.event.Eventto better align with Bugsnag libraries on other platforms. TheNotificationclass is functionally equivalent and will be removed in a future release. Event.meta_datahas been renamed toEvent.metadataRequestConfiguration.meta_datahas been renamed toRequestConfiguration.metadata
-
Added a
requestproperty 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-Forheader 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_typeto add atypeproperty to the app metadata of an event. #212 -
Support disabling automatic attachment of the request environment to events. Set
Configuration.send_environmenttoFalseto 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
asynciofeatures #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
requesttab 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_authenticatedin Django applications #143 -
Allow
exceptionoption to override a logged exception in handler callbacks #141
- Add support for tracking sessions and overall crash rate by setting
auto_capture_sessionsin 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_moduleswhen 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
Deliveryclass is a generic way of sending a serialized payload to Bugsnag. TheConfigurationclass now has adeliveryproperty which should be an instance ofDelivery. By default, if requests is installed, reports are sent viabugsnag.delivery.RequestsDeliveryrather 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 aConfigurationor options passed toClient(). By default, a client is installed as the system exception hook. To disable this behavior, setinstall_sys_hooktoFalse.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
exceptionsas 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)
BugsnagHandlerargumentapi_keywas 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 aRuntimeErrorDelisa 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_keyandgrouping_hashfromnotify()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.REQUESTattribute in favor ofGET/POSTDelisa 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