Metadata-Version: 2.1
Name: django_json_logging
Version: 0.0.7
Summary: Various JSON logging extensions for the Django Framework
Home-page: https://github.com/vskrachkov/django_json_logging
Author: Vicheslav Krachkov
Author-email: vskrachkov@gmail.com
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: django>=2.2
Requires-Dist: json-log-formatter>=0.3.1, <=0.4.0

# django_json_logging
Various JSON logging extensions for the Django Framework

[![PyPI Version][pypi-image]][pypi-url]

[pypi-image]: https://img.shields.io/pypi/v/django_json_logging
[pypi-url]: https://pypi.org/project/django_json_logging/

# 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'}},
    ...
}
```

