Is there a Django middleware / plugin that logs all my requests in an organized manner?

I want to log every request that ever comes through my server. Is there a plugin / middleware for this?

Ideally, I would like it to be available for request.

+8
python django plugins logging
source share
3 answers

You are best off looking like django-request .

+3
source share

I don’t know what you want, but django-sentry is a great application for recording errors that occur on your Django site. They can be displayed in a (well-designed!) Web interface that allows you to sort by the number of errors, etc.

If you just want to log requests, Apache access.log should be enough. And I think there are many tools for analyzing and displaying the contents of Apache logs.

+4
source share

You should be logging inside your web server, not in Django. Although it can be registered, this is not what you would normally like to do.

If you really want this, here is an example of middleware:

class RequestLoggingMiddleware(object): def process_request(self, request): syslog.syslog(' '.join([ request.META['remote_addr'], request.get_full_path(), ])) 
+2
source share

All Articles