mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-16 03:51:07 +03:00
* fix: debug logging now visible on stderr when LDR_APP_DEBUG=true config_logger() had stderr hardcoded to INFO level regardless of the debug flag — only diagnose= was toggled, not the log level itself. DEBUG entries went to the DB sink but never to the console, making LDR_APP_DEBUG ineffective for local debugging via log files. Also adds restart_server_debug.sh for convenient debug-mode startup with LDR_APP_DEBUG=true and LDR_LOG_SETTINGS=summary. * fix: log warning when debug mode is active Emits a WARNING-level message on startup when LDR_APP_DEBUG=true so it's immediately visible in the logs that sensitive data may be logged.
40 lines
1.5 KiB
Bash
Executable File
40 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# Script to restart the LDR server with DEBUG logging enabled.
|
|
#
|
|
# WARNING: Debug logs may contain sensitive data (queries, answers, API responses).
|
|
# This is for local development and feature testing only.
|
|
# Do NOT use in production or with real user data.
|
|
|
|
echo "Stopping existing LDR server..."
|
|
pkill -f "python -m local_deep_research.web.app" 2>/dev/null || echo "No existing server found"
|
|
|
|
# Wait a moment for the process to stop
|
|
sleep 1
|
|
|
|
echo "Starting LDR server in DEBUG mode..."
|
|
# Change to the script's parent directory (project root)
|
|
cd "$(dirname "$0")/../.." || exit 1
|
|
|
|
# Start server in background and detach from terminal
|
|
(nohup env LDR_APP_DEBUG=true LDR_LOG_SETTINGS=summary pdm run python -m local_deep_research.web.app > /tmp/ldr_server.log 2>&1 &) &
|
|
SERVER_PID=$!
|
|
|
|
# Give it a moment to start
|
|
sleep 2
|
|
|
|
echo "Server started. PID: $SERVER_PID"
|
|
echo "Logs: /tmp/ldr_server.log"
|
|
echo "URL: http://127.0.0.1:5000"
|
|
echo ""
|
|
echo "WARNING: Running in DEBUG mode (LDR_APP_DEBUG=true)"
|
|
echo " - Debug logs may contain sensitive data (queries, answers, API responses)"
|
|
echo " - For local development and feature testing only"
|
|
echo " - Do NOT use in production or with real user data"
|
|
echo ""
|
|
echo "To check server status: ps aux | grep 'python -m local_deep_research.web.app'"
|
|
echo "To view logs: tail -f /tmp/ldr_server.log"
|
|
echo "To stop server: pkill -f 'python -m local_deep_research.web.app'"
|
|
|
|
# Exit immediately - don't wait for background process
|
|
exit 0
|