From 30a9425297bb0ef3654f3a760496209fc4dc5fd5 Mon Sep 17 00:00:00 2001 From: sandyr Date: Tue, 12 Sep 2023 15:55:24 +0100 Subject: [PATCH] filter out myaccounts endpoint from logs (to avoid heavy log spam) --- emgcli/settings.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/emgcli/settings.py b/emgcli/settings.py index 6e97afbb0..d31947da0 100644 --- a/emgcli/settings.py +++ b/emgcli/settings.py @@ -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': { @@ -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'],