django-log-formatter-asim 0.0.0__py3-none-any.whl → 0.0.1__py3-none-any.whl
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.
- django_log_formatter_asim/__init__.py +4 -8
- {django_log_formatter_asim-0.0.0.dist-info → django_log_formatter_asim-0.0.1.dist-info}/METADATA +2 -3
- django_log_formatter_asim-0.0.1.dist-info/RECORD +5 -0
- django_log_formatter_asim-0.0.0.dist-info/RECORD +0 -5
- {django_log_formatter_asim-0.0.0.dist-info → django_log_formatter_asim-0.0.1.dist-info}/LICENSE +0 -0
- {django_log_formatter_asim-0.0.0.dist-info → django_log_formatter_asim-0.0.1.dist-info}/WHEEL +0 -0
|
@@ -22,7 +22,7 @@ class ASIMFormatterBase:
|
|
|
22
22
|
user.first_name = "{{FIRST_NAME}}"
|
|
23
23
|
user.last_name = "{{LAST_NAME}}"
|
|
24
24
|
|
|
25
|
-
def
|
|
25
|
+
def get_log_dict(self):
|
|
26
26
|
record = self.record
|
|
27
27
|
log_time = datetime.utcfromtimestamp(record.created).isoformat()
|
|
28
28
|
log_dict = {
|
|
@@ -68,16 +68,12 @@ class ASIMFormatterBase:
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
class ASIMSystemFormatter(ASIMFormatterBase):
|
|
71
|
-
|
|
72
|
-
return self._get_log_dict_base()
|
|
71
|
+
pass
|
|
73
72
|
|
|
74
73
|
|
|
75
74
|
class ASIMRequestFormatter(ASIMFormatterBase):
|
|
76
|
-
def __init__(self, record):
|
|
77
|
-
super().__init__(record)
|
|
78
|
-
|
|
79
75
|
def get_log_dict(self):
|
|
80
|
-
log_dict =
|
|
76
|
+
log_dict = super().get_log_dict()
|
|
81
77
|
|
|
82
78
|
request = self.record.request
|
|
83
79
|
|
|
@@ -118,7 +114,7 @@ class ASIMRequestFormatter(ASIMFormatterBase):
|
|
|
118
114
|
request = self.record.request
|
|
119
115
|
http_user_agent = getattr(request, "user_agent", None)
|
|
120
116
|
if not http_user_agent:
|
|
121
|
-
http_user_agent = getattr(request.headers, "
|
|
117
|
+
http_user_agent = getattr(request.headers, "User-Agent", None)
|
|
122
118
|
if not http_user_agent:
|
|
123
119
|
http_user_agent = request.META.get("HTTP_USER_AGENT", None)
|
|
124
120
|
return http_user_agent
|
{django_log_formatter_asim-0.0.0.dist-info → django_log_formatter_asim-0.0.1.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-log-formatter-asim
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.1
|
|
4
4
|
Summary: Formats Django logs in ASIM format.
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Department for Business and Trade Platform Team
|
|
@@ -12,8 +12,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
-
Requires-Dist: django (>=
|
|
16
|
-
Requires-Dist: django-ipware (>=5.0.2,<6.0.0)
|
|
15
|
+
Requires-Dist: django (>=3,<5)
|
|
17
16
|
Description-Content-Type: text/markdown
|
|
18
17
|
|
|
19
18
|
# Django ASIM log formatter
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
django_log_formatter_asim/__init__.py,sha256=bEay6Euo1CcOpvlP0IKu1F8CRknWWkgT5L4fAZ4ss70,4741
|
|
2
|
+
django_log_formatter_asim-0.0.1.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
|
|
3
|
+
django_log_formatter_asim-0.0.1.dist-info/METADATA,sha256=rKTyDTTaIWes8Rk4oRgrcgTY2gKYtL1AO-j309FMt1w,3906
|
|
4
|
+
django_log_formatter_asim-0.0.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
5
|
+
django_log_formatter_asim-0.0.1.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
django_log_formatter_asim/__init__.py,sha256=5p108YUsnIydf9SifKIlAUD4vypHGZcwPFkRCQkEmSk,4876
|
|
2
|
-
django_log_formatter_asim-0.0.0.dist-info/LICENSE,sha256=dP79lN73--7LMApnankTGLqDbImXg8iYFqWgnExGkGk,1090
|
|
3
|
-
django_log_formatter_asim-0.0.0.dist-info/METADATA,sha256=dZw11xIRznFQB9DpvoiS4nkSVWJaxEYIHck5Jgkwfpc,3960
|
|
4
|
-
django_log_formatter_asim-0.0.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
5
|
-
django_log_formatter_asim-0.0.0.dist-info/RECORD,,
|
{django_log_formatter_asim-0.0.0.dist-info → django_log_formatter_asim-0.0.1.dist-info}/LICENSE
RENAMED
|
File without changes
|
{django_log_formatter_asim-0.0.0.dist-info → django_log_formatter_asim-0.0.1.dist-info}/WHEEL
RENAMED
|
File without changes
|