A package for logging all requests
Project description
Logging
Middleware для логирования request запросов на endpoint.
Quick start
-
Add "django_logging" to your INSTALLED_APPS setting like this.
INSTALLED_APPS = [ ... 'django_logging', ... ]
-
Create
logging
handlers withLOGGING
name withinsettings.py
. The middleware uses handlers with names:info_logger
anderror_logger
.LOGGING = { 'formatters': { ... }, 'handlers': { ... }, 'loggers': { 'info_logger': { 'handlers': ['info'], 'level': 'INFO' }, 'error_logger': { 'handlers': ['error'], }, } }
-
Create
LOGGING_SERVER_NAME
withingsettings.py
. The middleware uses this variable as server name key in every log message.LOGGING_SERVER_NAME = 'server name'
-
Create
AUTHENTICATION_HEADER
withinsettings.py
. The middleware try to get user information from this header in jwt format.AUTHENTICATION_HEADER = 'Authentication'
-
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
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_logging_requests-1.3.1.tar.gz
.
File metadata
- Download URL: django_logging_requests-1.3.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1464e2a77c404db5be6064907b0b22b3f7ab172a99d400eba2a07abdc2ebad82 |
|
MD5 | 439db1547ce117bbdbcdb8a95bdb3575 |
|
BLAKE2b-256 | 64011205d90a7e2f3f8f0fc6e20bb9ffeb2550da37cd2737415fd39aad0b9279 |
File details
Details for the file django_logging_requests-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: django_logging_requests-1.3.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 859854393d9dec6d63f0a8ef8b338ce4a2d3f7b8a53b714521c385dc6048b375 |
|
MD5 | 83c2e09dd5e4117bef5e9fc7e7e3aed0 |
|
BLAKE2b-256 | 28417c01e736a55c88e5852ac23520bb7aa7e20059634e5a6dce58e5d639db3b |