A simple Django middleware for logging requests, function calls, and exceptions.
You can install logging_middleware using pip:
pip install git+https://github.com/Pyxis-Cognitive-Solutions/logging_middleware- Add
logging_middleware.JsonLoggingMiddlewareto theMIDDLEWARElist in your Django settings:
MIDDLEWARE = [
...
'logging_middleware.JsonLoggingMiddleware',
...
]- Logs incoming requests, including method, URL, and headers.
- Logs function calls with arguments and return values.
- Logs exceptions with stack traces for easier debugging.
This project is licensed under the MIT License.