Skip to main content

Logging

Middleware для логирования request запросов на endpoint.

Quick start

  1. Add "django_logging" to your INSTALLED_APPS setting like this.

        INSTALLED_APPS = [
            ...
            'django_logging',
            ...
        ]
    
  2. Create logging handlers with LOGGING name within settings.py. The middleware uses handlers with names: info_logger and error_logger .

    LOGGING = {
        'formatters': {
            ...
        },
        'handlers': {
            ...
        },
        'loggers': {
            'info_logger': {
                'handlers': ['info'],
                'level': 'INFO'
            },
            'error_logger': {
                'handlers': ['error'],
            },
        }
    }
    
  3. Create LOGGING_SERVER_NAME withing settings.py. The middleware uses this variable as server name key in every log message.

    LOGGING_SERVER_NAME = 'server name'
    
  4. Create AUTHENTICATION_HEADER within settings.py. The middleware try to get user information from this header in jwt format.

    AUTHENTICATION_HEADER = 'Authentication'
    
  5. Add a middleware class to listen in on responses

    MIDDLEWARE = [
        ...,
        "django_logging.middleware.LoggingMiddleware",
        ...,
    ]
    

    It's better to set as low as possible.

Release

Pushing to master branch will run auto build new version and push it to pypi. Before pushing to master branch must update version in setup.py.

Metadata

Release files for django-logging-requests 1.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-logging-requests 1.3.5
File Size Uploaded Provenance
django_logging_requests-1.3.5.tar.gz 4.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-logging-requests 1.3.5
File Interpreter ABI Platform
django_logging_requests-1.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / django_logging_requests-1.3.5.tar.gz

Download URL django_logging_requests-1.3.5.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
db97d29e004c563df70a0ae1ace95159c551405664765d40a0df0c65205e141c
BLAKE2b-256 checksum
How to use checksums
ee76f87f4edee4dd80e69a35ee2d94716f2012fbc70d8feca02c8a306a93164a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Release files / django_logging_requests-1.3.5-py3-none-any.whl

Download URL django_logging_requests-1.3.5-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7f2df1fb7d85b54100aebc72303099420dc122cefde1b40976a4eca7554aeb4
BLAKE2b-256 checksum
How to use checksums
686c5a79e5f0b0970e4b1dc0af29bc4a17a491de64dc97cb785c0b3da0bc2555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.0

Security for django-logging-requests 1.3.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page