Skip to main content

Request Log middleware

Project description

======================
Requset Log Middleware
======================

Request log middleware to capture meta data associated with each user request into mongo database. The write acknowledgement at time of save to mongo is disabled to ensure there is minimum performance lag due to this middleware.

Note: this is work in progress - expect bugs etc

Requirements
===========

pymongo
celery
Mongo
Tested on Django > 1.3

Setup / Installation
====================

* Install the package using pip
pip install requestlogs

Update settings.py

* Add app 'requestlogs' to your INSTALLED_APPS
* Add 'requestlogs.middleware.RequestLogMiddleware' to MIDDLEWARE_CLASSES after auth
* Customize the name and mongo connections
RLOG_APP_NAME = 'myapp' # used to uniquely identify the collection
RLOG_MONGODB_URI = 'mongodb://127.0.0.1:27017/requestlogs_db?w=-1' # mongodb to capture request logs
# mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]
# refer: http://docs.mongodb.org/manual/reference/connection-string/

ToDos
=====
This package is still under development, following are the high level items to be implemented

* Capture custom session variable
* Add views to pull transactions by user
* Add views to search transactions by user and datetime
* Test cases

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

RequestLogs-0.2dev.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file RequestLogs-0.2dev.tar.gz.

File metadata

  • Download URL: RequestLogs-0.2dev.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for RequestLogs-0.2dev.tar.gz
Algorithm Hash digest
SHA256 a849eb614c40251a50fa2699483762594e4b9fc5a83805d8de28fa9b324fe554
MD5 ae574307b1acc4db284a818bb72c1f15
BLAKE2b-256 3fab9df23064bdbd97629505c486d08de923c52b500288b2ef8e2776b0161a89

See more details on using hashes here.

Supported by

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