Skip to main content

No project description provided

Project description

request_log_info

Installing

$ pip install request-log-info

Then add request_log.middleware.LoggingMiddleware to your MIDDLEWARE.

For example:

MIDDLEWARE = (
    ...,   
    'request_log.middleware.LoggingMiddleware',
    ...,
)

And configure logging in your app:

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'request': {
            'format': '%(type)s' + '[%(asctime)s]' + ' ip:%(ip)s,' + ' url:%(path)s,' +
                      ' method:%(method)s, ' + '%(data)s '
        },
    },
    'handlers': {
        'info': {
            'class': 'request_log.utils.RequestRotatingFileLogger',
            'formatter': 'request'
        },
    },
    'loggers': {
        'request': {
            'level': 'DEBUG',  # change debug level as appropiate
            'handlers': ['info'],
            'propagate': False,
        },
    },
}

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

request_log_info-1.0.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Supported by

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