Skip to main content

Airbrake exception logger for django

Project description

Django Airbrake provides a logging handler to push exceptions and other errors to airbrakeapp or other airbrake-compatible exception handler services (e.g. aTech Media’s Codebase).

Installation

Installation with pip:

$ pip install django-airbrake

Add 'airbrake.handlers.AirbrakeHandler' as a logging handler:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'filters': {
        'require_debug_false': {
            '()': 'django.utils.log.RequireDebugFalse'
        }
    },
    'handlers': {
        'airbrake': {
            'level': 'WARNING',
            'class': 'airbrake.handlers.AirbrakeHandler',
            'api_key': '[your-api-key]',
            'env_name': 'develop',
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['airbrake',],
            'level': 'WARNING',
            'propagate': True,
        },
    }
}

Settings

level (built-in setting) Change the level to 'ERROR' to disable logging of 404 error messages.

api_key (required)

API key provided by the exception handler system.

env_name (required)

Name of the environment (e.g. production, develop, testing)

api_url

To use aTech Media’s Codebase exception system, provide an extra setting api_url with the value 'https://exceptions.codebasehq.com/notifier_api/v2/notices'.

env_variables

List of environment variables that should be included in the error message, defaults to ['DJANGO_SETTINGS_MODULE',].

timeout

Timeout in seconds to send the error report, defaults to 30 seconds.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-airbrake-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

File details

Details for the file django-airbrake-0.1.0.tar.gz.

File metadata

File hashes

Hashes for django-airbrake-0.1.0.tar.gz
Algorithm Hash digest
SHA256 96e7187a74c769d7e37a988129c9a8df67586ce4e484c085877cc03faa985aed
MD5 7c46ea8b590719eb28bbd2d304e4ad0e
BLAKE2b-256 1a3cb5fb8c3f6628fe66028442f23286d9a6d5fef10059c740ec5244563cec01

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page