Add monitoring, metrics tracking, and enhanced logging
- Add BotMonitor class for tracking requests, errors, and health status - Track request success/failure, response times, error rates - Add !status command (admin) for detailed metrics with embed - Add !health command (anyone) for quick health check - Add rotating file logging support (LOG_FILE config) - Auto-detect unhealthy status when errors exceed threshold - Record errors with timestamps and context for debugging
This commit is contained in:
14
.env.example
14
.env.example
@@ -62,7 +62,19 @@ SEARXNG_ENABLED=true
|
||||
SEARXNG_MAX_RESULTS=5
|
||||
|
||||
# ===========================================
|
||||
# Logging
|
||||
# Logging & Monitoring
|
||||
# ===========================================
|
||||
# Log level: DEBUG, INFO, WARNING, ERROR
|
||||
LOG_LEVEL=INFO
|
||||
|
||||
# Log file path (optional - logs to console only if not set)
|
||||
# LOG_FILE=logs/bot.log
|
||||
|
||||
# Custom log format (optional)
|
||||
# LOG_FORMAT=%(asctime)s - %(name)s - %(levelname)s - %(message)s
|
||||
|
||||
# ===========================================
|
||||
# Monitoring Commands
|
||||
# ===========================================
|
||||
# Use !status (admin only) for detailed metrics
|
||||
# Use !health (anyone) for quick health check
|
||||
|
||||
Reference in New Issue
Block a user