Metadata-Version: 2.1
Name: django-detailed-request-logging
Version: 1.0.1
Summary: Middleware to log requests in Django with more detailed information.
Home-page: https://git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging
Author: Jaroslaw Surkont, Gerhard Bräunlich, Robin Engler, Christian Ribeaud, François Martin
Author-email: jaroslaw.surkont@unibas.ch, gerhard.braeunlich@id.ethz.ch, robin.engler@sib.swiss, christian.ribeaud@karakun.com, francois.martin@karakun.com
License: LGPL3
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: Django (>=3.2)
Requires-Dist: djangorestframework (>=3.12)
Provides-Extra: test
Requires-Dist: assertpy ; extra == 'test'
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: pytest-django ; extra == 'test'

[![pipeline status](https://git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging/badges/dev/pipeline.svg)](https://git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging/-/commits/dev)
[![coverage report](https://git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging/badges/dev/coverage.svg)](https://git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging/-/commits/dev)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# django-detailed-request-logging

## Releases

This project follows the [semantic versioning specification](https://semver.org/) for its [releases](https://git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging/-/releases).

## Development

### Requirements

- Python >=3.7
- Django >=3.2
- django-rest-framework >=3.12

### Setup

- Create and activate a python3 venv.
- Install the library in the editable mode `pip install -e .[test]`
- Install dev requirements `pip install -r requirements-dev.txt`.
- Install git hooks to automatically format code using black with `pre-commit install`

## Installation

### From git in `requirements.txt`

To install this package from this git repository, add the following to the `requirements.txt` file:

```bash
git+ssh://git@git.dcc.sib.swiss/biwg/libweb/django-detailed-request-logging.git@master#egg=django-detailed-request-logging
```

To use it, add the following entry to `MIDDLEWARE` inside of your `settings.py` file:

```python
MIDDLEWARE = [
    ...,
    "django_detailed_request_logging.middleware.LoggingMiddleware",
]
```

Then, add a new entry `LOGGING_REQUEST_MIDDLEWARE` to your `settings.py` file, changing the value of `apps` to the
names of the apps you want to log requests on and changing the value of `skip_methods` to include all HTTP methods
you do **NOT** want to get logged:

```python
LOGGING_REQUEST_MIDDLEWARE = {
    "apps": ("projects",),
    "skip_methods": ("OPTIONS",),
}
```


