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
Hashes for django_logging_requests-1.3.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | db97d29e004c563df70a0ae1ace95159c551405664765d40a0df0c65205e141c |
|
MD5 | fd5e8f02e5ef09cc7594ea41bc63e8b0 |
|
BLAKE2b-256 | ee76f87f4edee4dd80e69a35ee2d94716f2012fbc70d8feca02c8a306a93164a |
Hashes for django_logging_requests-1.3.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7f2df1fb7d85b54100aebc72303099420dc122cefde1b40976a4eca7554aeb4 |
|
MD5 | 9c8c89d7634b2d34be774b28dc165cf0 |
|
BLAKE2b-256 | 686c5a79e5f0b0970e4b1dc0af29bc4a17a491de64dc97cb785c0b3da0bc2555 |