Skip to content

Commit 5ed158e

Browse files
<Vishal> Clean exit added and internal doc updated.
1 parent fd0aa1e commit 5ed158e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drf_api_logger/apps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ def ready(self):
4747
t.daemon = True # Make it a daemon so it shuts down with the main thread
4848
t.name = LOG_THREAD_NAME # Assign a name to the thread for easy identification
4949
t.start() # Start the background log insertion thread
50+
LOGGER_THREAD = t

drf_api_logger/middleware/api_logger_middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from drf_api_logger import API_LOGGER_SIGNAL
1313
from drf_api_logger.apps import LOGGER_THREAD
14-
# from drf_api_logger.start_logger_when_server_starts import LOGGER_THREAD
1514
from drf_api_logger.utils import get_headers, get_client_ip, mask_sensitive_data
1615

1716

@@ -83,7 +82,8 @@ def __init__(self, get_response):
8382
def is_static_or_media_request(self, path):
8483
static_url = getattr(settings, 'STATIC_URL', '/static/')
8584
media_url = getattr(settings, 'MEDIA_URL', '/media/')
86-
85+
if static_url == '/' or media_url == '/':
86+
return False
8787
return path.startswith(static_url) or path.startswith(media_url)
8888

8989
def __call__(self, request):

0 commit comments

Comments
 (0)