fix logs (and import)
This commit is contained in:
+4
-3
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user