Skip to main content

WSGI middleware for recording requests/responses.

Project description

WSGI middleware for conditionally recording request/response information.

Install it:

$ pip install wsgim-record

and use it:

import wsgim_record

class RecordMiddleware(wsgim_record.RecordMiddleware)

    # tell what to record

    def record_input(self, environ)
        return True

    def record_errors(self, environ)
        return False

    def record_output(self, environ, status, headers, exc_info=None)
        return True

     # what was recorded

     def recorded(self, environ, input, errors, status, headers, output):

wrapped = RecordMiddleware(app)

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

wsgim-record-0.1.1.tar.gz (3.7 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page