Correlation IDs in Django for debugging requests
Project description
Logging is important. Anyone who has had a call at 3am to say the site is down knows this. Without quality logging it is almost impossible to work out what on earth is happening.
Even with plenty of logs it can be hard to track down exactly what the effects of a particular request are. Enter Django Correlation IDs. The approach is quite a simple one. Incoming requests are assigned a unique id (a uuid). This can either happen in say your public facing web server (e.g. nginx) or be applied as soon as it hits django.
This cid is then available throught the django request/response cycle. We provide filters for logging witch adds the cid to the logging record so you can add it to your formatting string. We also provide wrappers around all the standard database backends which adds the cid as a comment before each SQL request.
Features
Processing/Generation of a correlation id
Database wrappers to add correlation id to each sql call
Logging filter to inject the correlation id into logs
A template context processe to make correlation id available in templates
Output correlation id as a header
Documentation can be found at: http://django-correlation-id.readthedocs.org/
History
0.1.0 (2014-08-05)
First release on PyPI.
0.1.2 (2016-12-01)
Made CID repsonse header configurable, and optional (thanks @dbaty)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-cid-0.1.2.tar.gz
.
File metadata
- Download URL: django-cid-0.1.2.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 841015a66a5e9f33afccc39f14a16957137ef9ccee4600534972924ab171774a |
|
MD5 | 011065329e82c6190b68718d329a24e8 |
|
BLAKE2b-256 | ab2d45a5072912e4269c39045e776b8b322e6b24495b540390ff6f14c2c30af2 |
Provenance
File details
Details for the file django_cid-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_cid-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8994dc9d83244bbd8df2d91b7852846e55b2c66e9201153ce72cefe10392548 |
|
MD5 | d1e6a18c5b498526ed8fa958e6cdf2c7 |
|
BLAKE2b-256 | 415db4d00274eadae01dd9b4e4a5cf65534d11b080189b87dbcb5f9caa85cca3 |