Logs requests and responses to your application in a DB for auditing or troubleshooting purposes.
Project description
Logs requests and responses to your application in a DB for auditing or troubleshooting purposes.
Inspiration
This is heavily inspired by and borrows a lot from nathforge/django-wiretap.
Why a new package?
The fundamental difference is not letting settings.DEBUG determine if a message should be tapped. I have needs, yes in PRODUCTION, where this is useful to me.
Usage
Install the package with:
pip install django-rapyd-wiretap
Edit Django settings:
Add wiretap to INSTALLED_APPS.
Add wiretap.middleware.WiretapMiddleware to your MIDDLEWARE_CLASSES.
Create models with:
./manage.py migrate
Go to Django admin, add a new Tap.
This contains a path, which is matched against the full path including the query string. A valid regex is allowed here.
For example, to capture everything within the /api/ path of your site, use ^/api/.
To capture everything, set it to /.
To Do
Add support for configuring retention per tap and deleting older messages.
Add support for prettifying major content types for easy troubleshooting.
Delegate logging request and response bodies to a separate file on the file system keeping the DB lean for faster queries. Maybe? I’m still divided on this.
I’m sure there are other things I haven’t thought of yet or those that will be needed by the community.
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
File details
Details for the file django-rapyd-wiretap-0.0.4.tar.gz
.
File metadata
- Download URL: django-rapyd-wiretap-0.0.4.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a46340328cb3fe03a8ac8a583a52b91576f6d1d25dc92b4b841a2efdfc537c81 |
|
MD5 | 623a9b702c669bd79f1e3105f19ea683 |
|
BLAKE2b-256 | c1e40875adacac3d79b121088e8f2dc65ef71a8a9b60db26db2004ff42b0ed7f |