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 Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page