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.

Files for request-log-info, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size request_log_info-1.0.0.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page