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 read_only_admin 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
Hashes for django-rapyd-wiretap-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3330413fd4d9b623f22b3a7396a18113d4e615ce228e4cc12f383ab3b10f587d |
|
MD5 | d32d495060aeee4708a2db98f076bdd4 |
|
BLAKE2b-256 | ce4f5017542233539fdc9c2dc90663de5a4d9f5977c52913c162ce14f7440df7 |