Skip to content

Commit

Permalink
➕[#344] Add django-log-outgoing-requests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal authored and Coperh committed Apr 9, 2024
1 parent 5f60a5b commit 65bf741
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jsonschema
django~=4.2
django-admin-index
django-axes
django-log-outgoing-requests
django-redis
django-rosetta
maykin-2fa
Expand Down
8 changes: 8 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ django==4.2.11
# -r requirements/base.in
# commonground-api-common
# django-admin-index
# django-appconf
# django-axes
# django-filter
# django-formtools
# django-jsonform
# django-log-outgoing-requests
# django-markup
# django-otp
# django-phonenumber-field
Expand All @@ -94,6 +96,8 @@ django==4.2.11
# zgw-consumers
django-admin-index==3.1.0
# via -r requirements/base.in
django-appconf==1.0.6
# via django-log-outgoing-requests
django-axes==6.3.0
# via -r requirements/base.in
django-filter==23.5
Expand All @@ -104,6 +108,8 @@ django-formtools==2.3
# via django-two-factor-auth
django-jsonform==2.21.4
# via mozilla-django-oidc-db
django-log-outgoing-requests==0.6.1
# via -r requirements/base.in
django-markup==1.3
# via commonground-api-common
django-ordered-model==3.7.4
Expand All @@ -129,6 +135,7 @@ django-simple-certmanager==1.4.1
django-solo==2.2.0
# via
# commonground-api-common
# django-log-outgoing-requests
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
Expand Down Expand Up @@ -269,6 +276,7 @@ requests==2.25.1
# via
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# django-rosetta
# gemma-zds-client
# mozilla-django-oidc
Expand Down
10 changes: 10 additions & 0 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ django==4.2.11
# -r requirements/base.txt
# commonground-api-common
# django-admin-index
# django-appconf
# django-axes
# django-filter
# django-formtools
# django-jsonform
# django-log-outgoing-requests
# django-markup
# django-otp
# django-phonenumber-field
Expand All @@ -131,6 +133,10 @@ django==4.2.11
# zgw-consumers
django-admin-index==3.1.0
# via -r requirements/base.txt
django-appconf==1.0.6
# via
# -r requirements/base.txt
# django-log-outgoing-requests
django-axes==6.3.0
# via -r requirements/base.txt
django-filter==23.5
Expand All @@ -145,6 +151,8 @@ django-jsonform==2.21.4
# via
# -r requirements/base.txt
# mozilla-django-oidc-db
django-log-outgoing-requests==0.6.1
# via -r requirements/base.txt
django-markup==1.3
# via
# -r requirements/base.txt
Expand Down Expand Up @@ -189,6 +197,7 @@ django-solo==2.2.0
# via
# -r requirements/base.txt
# commonground-api-common
# django-log-outgoing-requests
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
Expand Down Expand Up @@ -402,6 +411,7 @@ requests==2.25.1
# -r requirements/base.txt
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# django-rosetta
# gemma-zds-client
# mozilla-django-oidc
Expand Down
10 changes: 10 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ django==4.2.11
# -r requirements/ci.txt
# commonground-api-common
# django-admin-index
# django-appconf
# django-axes
# django-debug-toolbar
# django-extensions
# django-filter
# django-formtools
# django-jsonform
# django-log-outgoing-requests
# django-markup
# django-otp
# django-phonenumber-field
Expand All @@ -153,6 +155,10 @@ django==4.2.11
# zgw-consumers
django-admin-index==3.1.0
# via -r requirements/ci.txt
django-appconf==1.0.6
# via
# -r requirements/ci.txt
# django-log-outgoing-requests
django-axes==6.3.0
# via -r requirements/ci.txt
django-debug-toolbar==4.2.0
Expand All @@ -171,6 +177,8 @@ django-jsonform==2.21.4
# via
# -r requirements/ci.txt
# mozilla-django-oidc-db
django-log-outgoing-requests==0.6.1
# via -r requirements/ci.txt
django-markup==1.3
# via -r requirements/ci.txt
django-ordered-model==3.7.4
Expand Down Expand Up @@ -213,6 +221,7 @@ django-solo==2.2.0
# via
# -r requirements/ci.txt
# commonground-api-common
# django-log-outgoing-requests
# mozilla-django-oidc-db
# notifications-api-common
# zgw-consumers
Expand Down Expand Up @@ -465,6 +474,7 @@ requests==2.25.1
# -r requirements/ci.txt
# commonground-api-common
# coreapi
# django-log-outgoing-requests
# django-rosetta
# gemma-zds-client
# mozilla-django-oidc
Expand Down
17 changes: 17 additions & 0 deletions src/objects/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django.urls import reverse_lazy

from log_outgoing_requests.formatters import HttpFormatter
from sentry_sdk.integrations import django, redis

from .api import * # noqa
Expand Down Expand Up @@ -98,6 +99,7 @@
# External applications.
"axes",
"drf_spectacular",
"log_outgoing_requests",
"mozilla_django_oidc",
"mozilla_django_oidc_db",
"django_jsonform",
Expand Down Expand Up @@ -244,6 +246,7 @@
"performance": {
"format": "%(asctime)s %(process)d | %(thread)d | %(message)s",
},
"outgoing_requests": {"()": HttpFormatter},
},
"filters": {
"require_debug_false": {"()": "django.utils.log.RequireDebugFalse"},
Expand Down Expand Up @@ -287,6 +290,15 @@
"maxBytes": 1024 * 1024 * 10, # 10 MB
"backupCount": 10,
},
"log_outgoing_requests": {
"level": "DEBUG",
"formatter": "outgoing_requests",
"class": "logging.StreamHandler",
},
"save_outgoing_requests": {
"level": "DEBUG",
"class": "log_outgoing_requests.handlers.DatabaseOutgoingRequestsHandler",
},
},
"loggers": {
"objects": {
Expand All @@ -308,6 +320,11 @@
"handlers": ["project"],
"level": "DEBUG",
},
"log_outgoing_requests": {
"handlers": ["log_outgoing_requests", "save_outgoing_requests"],
"level": "DEBUG",
"propagate": True,
},
},
}

Expand Down
8 changes: 8 additions & 0 deletions src/objects/fixtures/default_admin_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@
[
"mozilla_django_oidc_db",
"openidconnectconfig"
],
[
"log_outgoing_requests",
"outgoingrequestslog"
],
[
"log_outgoing_requests",
"outgoingrequestslogconfig"
]
]
}
Expand Down

0 comments on commit 65bf741

Please sign in to comment.