fix logs (and import)

This commit is contained in:
Ross
2026-06-03 21:00:05 +01:00
parent 3d445fe12e
commit 0f11f0800e
6 changed files with 18 additions and 15 deletions
+4 -3
View File
@@ -105,6 +105,7 @@ from django.db.models import Q
from dal import autocomplete
from loguru import logger
from .logging_setup import get_log_file_path
import psutil
@@ -295,13 +296,13 @@ def account_send_password_reset(request, slug):
@user_passes_test(lambda u: u.is_superuser)
def logs_view(request):
"""Display production logs from log.txt with search filtering.
"""Display production logs with search/filter controls.
Scope: superusers only.
Functionality: reads log.txt, displays entries with optional text search filter.
Functionality: reads the configured application log file and displays entries with optional text search filter.
Supports ?all=1 to show all entries without pagination limit.
"""
log_file_path = os.path.join(settings.BASE_DIR, "log.txt")
log_file_path = str(get_log_file_path())
search_query = request.GET.get("q", "").strip()
level_filter = request.GET.get("level", "").strip().upper()
show_all = request.GET.get("all") == "1"