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 hashes)

Uploaded Source

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