mh_structlog 0.0.52__tar.gz → 0.0.53__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/PKG-INFO +1 -1
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/pyproject.toml +1 -1
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/src/mh_structlog/django.py +4 -0
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/README.md +0 -0
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/src/mh_structlog/__init__.py +0 -0
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/src/mh_structlog/aws.py +0 -0
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/src/mh_structlog/config.py +0 -0
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/src/mh_structlog/processors.py +0 -0
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/src/mh_structlog/sentry.py +0 -0
- {mh_structlog-0.0.52 → mh_structlog-0.0.53}/src/mh_structlog/utils.py +0 -0
|
@@ -8,7 +8,7 @@ authors = [
|
|
|
8
8
|
{ name = "Mathieu Hinderyckx", email = "mathieu.hinderyckx@gmail.com" },
|
|
9
9
|
]
|
|
10
10
|
description = "Some Structlog configuration and wrappers to easily use structlog."
|
|
11
|
-
version = "0.0.
|
|
11
|
+
version = "0.0.53"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.10"
|
|
14
14
|
classifiers = [
|
|
@@ -3,6 +3,7 @@ import time
|
|
|
3
3
|
import structlog
|
|
4
4
|
from asgiref.sync import iscoroutinefunction
|
|
5
5
|
from django.http import HttpRequest, HttpResponse
|
|
6
|
+
from django.http.response import HttpResponseRedirectBase
|
|
6
7
|
from django.utils.decorators import sync_and_async_middleware
|
|
7
8
|
|
|
8
9
|
from mh_structlog.config import SELECTED_LOG_FORMAT # noqa: PLC0415
|
|
@@ -21,6 +22,9 @@ def get_fields_to_log(request: HttpRequest, response: HttpResponse, latency_ms:
|
|
|
21
22
|
'referrer': request.headers.get('Referer', ''),
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
if isinstance(response, HttpResponseRedirectBase):
|
|
26
|
+
fields_to_log['redirect_url'] = response['Location']
|
|
27
|
+
|
|
24
28
|
if SELECTED_LOG_FORMAT == 'gcp_json':
|
|
25
29
|
fields_to_log['httpRequest'] = {
|
|
26
30
|
'requestMethod': request.method,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|