Skip to content

Commit

Permalink
filter out myaccounts endpoint from logs (to avoid heavy log spam)
Browse files Browse the repository at this point in the history
  • Loading branch information
SandyRogers committed Sep 12, 2023
1 parent 61af088 commit 30a9425
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions emgcli/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue',
},
'exclude_myaccounts': {
'()': 'django.utils.log.CallbackFilter',
'callback': lambda record: "v1/utils/myaccounts" not in record.getMessage(),
},
},
'formatters': {
'default': {
Expand Down Expand Up @@ -131,12 +135,19 @@
'django.request': { # Stop SQL debug from logging to main logger
'handlers': ['default'],
'level': 'INFO',
'propagate': False
'propagate': False,
'filters': ['exclude_myaccounts'],
},
'django.server': {
'handlers': ['default'],
'level': 'INFO',
'propagate': False,
'filters': ['exclude_myaccounts'],
},
'django': {
'handlers': ['null'],
'level': 'INFO',
'propagate': True
'propagate': True,
},
'': {
'handlers': ['default', 'console'],
Expand Down

0 comments on commit 30a9425

Please sign in to comment.