Skip to main content

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

django-rapyd-wiretap-0.0.4.tar.gz (9.7 kB view details)

Uploaded Source

File details

Details for the file django-rapyd-wiretap-0.0.4.tar.gz.

File metadata

File hashes

Hashes for django-rapyd-wiretap-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a46340328cb3fe03a8ac8a583a52b91576f6d1d25dc92b4b841a2efdfc537c81
MD5 623a9b702c669bd79f1e3105f19ea683
BLAKE2b-256 c1e40875adacac3d79b121088e8f2dc65ef71a8a9b60db26db2004ff42b0ed7f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page