This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This package provides a logging filter and middleware to add information about the current request to the logging record.

Installation and Usage

Install the package, add django_requestlogging to settings.INSTALLED_APPS, add django_requestlogging.middleware.LogSetupMiddleware to settings.MIDDLEWARE_CLASSES, and add django_requestlogging.logging_filters.RequestFilter as a logging filter. See below for an example logging configuration.

The filter adds information about the current request to the logging record. The following keys can be substituted in the logging formatter string:

The user agent string, provided by the client.
The requested HTTP path.
The remote IP address.
The HTTP request method (e.g. GET, POST, PUT, DELETE, etc.)
The server protocol (e.g. HTTP, HTTPS, etc.)
The username for the logged-in user.

If any of this information cannot be extracted from the current request (or there is no current request), a hyphen '-' is substituted as a placeholder.

Logging Configuration Example

This logging configuration can be added to your DJANGO_SETTINGS_MODULE. It adds an unbound RequestFilter, which will be bound to the current request by the middleware and then unbound again at response time.

    'filters': {
        # Add an unbound RequestFilter.
        'request': {
            '()': 'django_requestlogging.logging_filters.RequestFilter',
    'formatters': {
        'request_format': {
            'format': '%(remote_addr)s %(username)s "%(request_method)s '
            '%(path_info)s %(server_protocol)s" %(http_user_agent)s '
            '%(message)s %(asctime)s',
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'filters': ['request'],
            'formatter': 'request_format',
    'loggers': {
        'myapp': {
            # Add your handlers that have the unbound request filter
            'handlers': ['console'],
            # Optionally, add the unbound request filter to your
            # application.
            'filters': ['request'],
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_requestlogging_redux-1.2.0-py3-none-any.whl (13.2 kB) Copy SHA256 Checksum SHA256 py3 Wheel Oct 14, 2016
django-requestlogging-redux-1.2.0.tar.gz (6.8 kB) Copy SHA256 Checksum SHA256 Source Oct 14, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting