From 9fd28cba0b25d44580e0183137bbb558f382cda2 Mon Sep 17 00:00:00 2001 From: Silvan Muehlemann Date: Mon, 4 Oct 2021 07:15:26 +0200 Subject: [PATCH] Updated Readme --- MANIFEST.in | 1 + README.md | 23 ++++++++++++++++++----- setup.py | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 999f85f..01a62fc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,3 +3,4 @@ include README.md recursive-exclude * __pycache__ recursive-exclude * *.py[co] recursive-exclude * *.orig + diff --git a/README.md b/README.md index 29394b6..681ce48 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -Requestlog -========== +Django-Requestlog +================= -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=muehlemann-popp_requestlog&metric=alert_status)](https://sonarcloud.io/dashboard?id=muehlemann-popp_requestlog) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=muehlemann-popp_requestlog&metric=coverage)](https://sonarcloud.io/dashboard?id=muehlemann-popp_requestlog) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=muehlemann-popp_requestlog&metric=alert_status)](https://sonarcloud.io/dashboard?id=muehlemann-popp_requestlog) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=muehlemann-popp_requestlog&metric=coverage)](https://sonarcloud.io/dashboard?id=muehlemann-popp_requestlog) ![PyPi](https://img.shields.io/pypi/v/django-requestlog.svg) -Middleware who logs each request with their headers and the body into the database for diagnostic purposes. +Middleware who logs each request with their headers and the body into to PostgreSQL for diagnostic purposes. Why Logging to the database? @@ -13,9 +13,22 @@ searched by people not having access to the server logs. Of course this only wor for low traffic sites. And I recommend to purge those logs regularly with the provided manage command or celery task. +What is logged? +--------------- + The log is written to the table `requestlog_requestlog`. -The body field is truncated at 1024 bytes. +* timestamp +* client IP address +* django user-id +* method +* URL +* header fields +* cookies +* query parameter +* POST body +* HTTP status code +* the first 1024 of the response Credits ------- diff --git a/setup.py b/setup.py index c79e583..4bec481 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setuptools.setup( name='django-requestlog', - version='1.1.7', + version='1.1.8', description='Middleware to log http requests to postgresql', long_description=README, packages=setuptools.find_packages(where="src"),