Skip to main content

Various JSON logging extensions for the Django Framework

Project description

django_json_logging

Various JSON logging extensions for the Django Framework

PyPI Version

Installation

Using pip

pip install django_json_logging

Using pipenv

pipenv install django_json_logging

Quick start

In your project’s settings.py add AccessLogMiddleware to MIDDLEWARE and add JSONFormatter to LOGGING.

MIDDLEWARE = [
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    ...
    'django_json_logging.middleware.AccessLogMiddleware',
]
LOGGING = {
    ...
    'formatters': {"json": {'()': 'django_json_logging.logging.JSONFormatter'}},
    ...
}

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_json_logging-0.0.7.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

django_json_logging-0.0.7-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

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