From 17a04a6b2efa71853cabadb45877f1369e55f4f2 Mon Sep 17 00:00:00 2001 From: senke Date: Sat, 3 Jan 2026 22:59:48 +0100 Subject: [PATCH] feat: centraliser tous les logs dans /var/log/veza avec rotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Configure LOG_DIR=/var/log/veza pour tous les services - Ajoute scripts de gestion des logs (setup, view, rotate) - Configure volume Docker partagé pour les logs - Logs organisés par service avec fichiers séparés pour les erreurs - Rotation automatique : 100MB, 10 backups, 30 jours, compression gzip - Documentation dans LOGGING.md et ENV_CONFIG.md Services configurés: - Backend API: backend-api.log, redis.log, db.log, rabbitmq.log - Chat Server: chat-server.log (à configurer) - Stream Server: stream-server.log (à configurer) Le backend API a déjà toute l'infrastructure de logging en place. Les serveurs chat et stream utiliseront LOG_DIR depuis l'environnement. --- ENV_CONFIG.md | 74 +++++++++++ LOGGING.md | 279 ++++++++++++++++++++++++++++++++++++++++ docker-compose.prod.yml | 151 ++++++++++++++++++++++ scripts/rotate_logs.sh | 101 +++++++++++++++ scripts/setup_logs.sh | 41 ++++++ scripts/view_logs.sh | 151 ++++++++++++++++++++++ 6 files changed, 797 insertions(+) create mode 100644 ENV_CONFIG.md create mode 100644 LOGGING.md create mode 100644 docker-compose.prod.yml create mode 100755 scripts/rotate_logs.sh create mode 100755 scripts/setup_logs.sh create mode 100755 scripts/view_logs.sh diff --git a/ENV_CONFIG.md b/ENV_CONFIG.md new file mode 100644 index 000000000..57de8c8a3 --- /dev/null +++ b/ENV_CONFIG.md @@ -0,0 +1,74 @@ +# Configuration des Variables d'Environnement + +## Backend API + +Pour activer le logging centralisé vers `/var/log/veza`, ajoutez ces variables à votre fichier `.env` : + +```bash +# Logging Configuration +LOG_DIR=/var/log/veza +LOG_LEVEL=INFO +``` + +Variables complètes recommandées : + +```bash +# Application +APP_ENV=development +APP_PORT=8080 +LOG_LEVEL=INFO +LOG_DIR=/var/log/veza + +# Database +DATABASE_URL=postgresql://veza:password@localhost:5432/veza + +# Redis +REDIS_URL=redis://localhost:6379 +REDIS_ENABLE=true + +# RabbitMQ +RABBITMQ_URL=amqp://veza:password@localhost:5672/%2f +RABBITMQ_ENABLE=true + +# Security +JWT_SECRET=your-secret-key-here-change-in-production +CORS_ALLOWED_ORIGINS=http://localhost:3000 + +# Services +STREAM_SERVER_URL=http://localhost:8082 +CHAT_SERVER_URL=http://localhost:8081 +``` + +## Chat Server + +Pour le serveur de chat, ajoutez : + +```bash +LOG_DIR=/var/log/veza +LOG_LEVEL=INFO +``` + +## Stream Server + +Pour le serveur de streaming, ajoutez : + +```bash +LOG_DIR=/var/log/veza +LOG_LEVEL=INFO +``` + +## Docker Production + +Les variables sont déjà configurées dans `docker-compose.prod.yml`. Assurez-vous de définir : + +```bash +export DB_PASSWORD=your-db-password +export RABBITMQ_PASSWORD=your-rabbitmq-password +export JWT_SECRET=your-jwt-secret +``` + +Avant de lancer : + +```bash +docker-compose -f docker-compose.prod.yml up -d +``` diff --git a/LOGGING.md b/LOGGING.md new file mode 100644 index 000000000..70466392b --- /dev/null +++ b/LOGGING.md @@ -0,0 +1,279 @@ +# Gestion des Logs Veza + +## Organisation des Logs + +Tous les logs de l'application Veza sont centralisés dans `/var/log/veza/` avec une organisation par service. + +### Structure des Fichiers + +``` +/var/log/veza/ +├── backend-api.log # Tous les logs du backend API +├── backend-api-error.log # Erreurs uniquement du backend API +├── redis.log # Logs Redis +├── redis-error.log # Erreurs Redis +├── db.log # Logs base de données +├── db-error.log # Erreurs base de données +├── rabbitmq.log # Logs RabbitMQ +├── rabbitmq-error.log # Erreurs RabbitMQ +├── chat-server.log # Logs du serveur de chat +├── chat-server-error.log # Erreurs du serveur de chat +├── stream-server.log # Logs du serveur de streaming +└── stream-server-error.log # Erreurs du serveur de streaming +``` + +### Rotation Automatique + +Les logs sont automatiquement rotés avec la configuration suivante : +- **Taille maximale** : 100 MB par fichier +- **Nombre de backups** : 10 fichiers conservés +- **Rétention** : 30 jours +- **Compression** : Les anciens fichiers sont compressés en `.gz` + +Les fichiers rotés sont nommés avec un suffixe numérique : +- `backend-api.log.1.gz` (le plus récent) +- `backend-api.log.2.gz` +- ... +- `backend-api.log.10.gz` (le plus ancien) + +## Configuration + +### Variables d'Environnement + +Pour activer le logging vers `/var/log/veza`, configurez la variable d'environnement : + +```bash +export LOG_DIR=/var/log/veza +``` + +Ajoutez cette ligne dans vos fichiers `.env` : + +```env +# Répertoire de logs +LOG_DIR=/var/log/veza + +# Niveau de log (DEBUG, INFO, WARN, ERROR) +LOG_LEVEL=INFO +``` + +### Permissions + +Le répertoire `/var/log/veza` doit être accessible en écriture par l'utilisateur qui exécute les services. + +Pour configurer les permissions : + +```bash +sudo bash scripts/setup_logs.sh +``` + +Ou manuellement : + +```bash +sudo mkdir -p /var/log/veza +sudo chown -R $USER:$USER /var/log/veza +sudo chmod 755 /var/log/veza +``` + +## Utilisation + +### Visualiser les Logs + +Le script `view_logs.sh` permet de visualiser facilement les logs : + +```bash +# Voir les logs du backend API +bash scripts/view_logs.sh backend-api + +# Voir uniquement les erreurs +bash scripts/view_logs.sh backend-api --errors + +# Suivre les logs en temps réel +bash scripts/view_logs.sh backend-api --follow + +# Filtrer par pattern +bash scripts/view_logs.sh backend-api -g "ERROR" + +# Afficher les 100 dernières lignes +bash scripts/view_logs.sh backend-api -n 100 + +# Vue d'ensemble de tous les services +bash scripts/view_logs.sh all +``` + +### Rotation Manuelle + +Pour forcer la rotation des logs : + +```bash +# Roter tous les logs +bash scripts/rotate_logs.sh all + +# Roter uniquement le backend API +bash scripts/rotate_logs.sh backend-api +``` + +### Commandes Utiles + +```bash +# Voir la taille des fichiers de logs +du -h /var/log/veza/*.log + +# Compter les erreurs dans les logs +grep -c "ERROR" /var/log/veza/backend-api.log + +# Voir les logs en temps réel avec coloration +tail -f /var/log/veza/backend-api.log | grep --color=auto "ERROR\|WARN" + +# Analyser les logs JSON (en production) +cat /var/log/veza/backend-api.log | jq '.level, .msg' + +# Rechercher un pattern dans tous les logs +grep -r "user_id=123" /var/log/veza/ +``` + +## Format des Logs + +### Développement + +En mode développement, les logs utilisent un format console lisible : + +``` +2026-01-03T22:54:47+01:00 INFO Backend API démarré port=8080 +2026-01-03T22:54:48+01:00 DEBUG Connexion Redis établie url=redis://localhost:6379 +``` + +### Production + +En mode production, les logs sont en JSON structuré pour faciliter l'analyse : + +```json +{ + "level": "info", + "ts": "2026-01-03T22:54:47.123Z", + "caller": "api/main.go:66", + "msg": "Backend API démarré", + "port": 8080, + "env": "production" +} +``` + +## Monitoring et Alertes + +### Surveiller les Erreurs + +Pour être alerté en cas d'erreurs critiques : + +```bash +# Surveiller les fichiers d'erreurs +watch -n 10 'tail -n 20 /var/log/veza/*-error.log' +``` + +### Agrégation de Logs (Optionnel) + +Pour une installation en production, vous pouvez configurer l'agrégation vers un service externe (Loki, Elasticsearch, etc.) : + +```env +LOG_AGGREGATION_ENABLED=true +LOG_AGGREGATION_ENDPOINT=http://loki:3100/loki/api/v1/push +LOG_AGGREGATION_BATCH_SIZE=100 +LOG_AGGREGATION_FLUSH_INTERVAL=5s +``` + +## Docker + +### Configuration + +Dans `docker-compose.prod.yml`, les logs sont montés via un volume partagé : + +```yaml +volumes: + veza_logs: + driver: local + driver_opts: + type: none + o: bind + device: /var/log/veza + +services: + backend: + volumes: + - veza_logs:/var/log/veza + environment: + - LOG_DIR=/var/log/veza +``` + +### Accès aux Logs + +```bash +# Voir les logs depuis le conteneur +docker exec veza_backend_prod tail -f /var/log/veza/backend-api.log + +# Copier les logs vers l'hôte +docker cp veza_backend_prod:/var/log/veza ./logs-backup +``` + +## Dépannage + +### Les logs ne sont pas créés + +1. Vérifier les permissions : + ```bash + ls -ld /var/log/veza + ``` + +2. Vérifier la variable d'environnement : + ```bash + echo $LOG_DIR + ``` + +3. Vérifier les logs de démarrage du service + +### Espace disque insuffisant + +1. Vérifier l'espace disponible : + ```bash + df -h /var/log/veza + ``` + +2. Nettoyer les anciens logs : + ```bash + # Supprimer les logs de plus de 30 jours + find /var/log/veza -name "*.gz" -mtime +30 -delete + ``` + +3. Réduire la rétention dans la configuration de rotation + +### Performance + +Si l'écriture des logs impacte les performances : + +1. Vérifier que la rotation est activée +2. Augmenter le niveau de log (passer de DEBUG à INFO) +3. Activer le sampling en production (déjà configuré) + +## Sécurité + +### Logs Sensibles + +Les secrets et données sensibles sont automatiquement filtrés des logs : +- Mots de passe +- Tokens JWT +- Clés API +- Informations de carte bancaire + +### Accès aux Logs + +Limitez l'accès aux fichiers de logs : + +```bash +# Permissions recommandées +chmod 640 /var/log/veza/*.log +chown $USER:$USER /var/log/veza/*.log +``` + +## Support + +Pour plus d'informations sur la configuration du logging, consultez : +- `veza-backend-api/internal/logging/logger.go` +- `veza-chat-server/src/structured_logging.rs` +- `veza-stream-server/src/logging.rs` (si applicable) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 000000000..d4076029b --- /dev/null +++ b/docker-compose.prod.yml @@ -0,0 +1,151 @@ +services: + # --- INFRASTRUCTURE --- + + postgres: + image: postgres:16-alpine + container_name: veza_postgres_prod + restart: unless-stopped + environment: + POSTGRES_USER: veza + POSTGRES_PASSWORD: ${DB_PASSWORD:-password} + POSTGRES_DB: veza + volumes: + - postgres_prod_data:/var/lib/postgresql/data + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U veza" ] + interval: 10s + timeout: 5s + retries: 5 + + redis: + image: redis:7-alpine + container_name: veza_redis_prod + restart: unless-stopped + command: redis-server --save 60 1 --loglevel warning + volumes: + - redis_prod_data:/data + healthcheck: + test: [ "CMD", "redis-cli", "ping" ] + interval: 10s + + rabbitmq: + image: rabbitmq:3-management-alpine + container_name: veza_rabbitmq_prod + restart: unless-stopped + environment: + RABBITMQ_DEFAULT_USER: veza + RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD:-password} + volumes: + - rabbitmq_prod_data:/var/lib/rabbitmq + healthcheck: + test: rabbitmq-diagnostics -q ping + interval: 20s + + clamav: + image: clamav/clamav:latest + container_name: veza_clamav_prod + restart: unless-stopped + deploy: + resources: + limits: + memory: 2G # ClamAV requires significant RAM for virus databases + + # --- APPLICATION SERVICES --- + + backend: + build: + context: ./veza-backend-api + dockerfile: Dockerfile.production + container_name: veza_backend_prod + restart: unless-stopped + environment: + - APP_ENV=production + - DB_HOST=postgres + - DB_PORT=5432 + - DB_USER=veza + - DB_PASSWORD=${DB_PASSWORD:-password} + - DB_NAME=veza + - REDIS_URL=redis:6379 + - RABBITMQ_URL=amqp://veza:${RABBITMQ_PASSWORD:-password}@rabbitmq:5672/%2f + - JWT_SECRET=${JWT_SECRET} + - ENABLE_CLAMAV=true + - CLAMAV_ADDRESS=clamav:3310 + - CLAMAV_REQUIRED=true + - LOG_DIR=/var/log/veza + - LOG_LEVEL=INFO + volumes: + - veza_logs:/var/log/veza + depends_on: + postgres: + condition: service_healthy + redis: + condition: service_healthy + rabbitmq: + condition: service_healthy + clamav: + condition: service_started + ports: + - "8080:8080" + + chat: + build: + context: ./veza-chat-server + dockerfile: Dockerfile.production + container_name: veza_chat_prod + restart: unless-stopped + environment: + - APP_ENV=production + - DATABASE_URL=postgres://veza:${DB_PASSWORD:-password}@postgres:5432/veza + - REDIS_URL=redis://redis:6379 + - LOG_DIR=/var/log/veza + - LOG_LEVEL=INFO + volumes: + - veza_logs:/var/log/veza + depends_on: + postgres: + condition: service_healthy + ports: + - "8081:8081" + + stream: + build: + context: ./veza-stream-server + dockerfile: Dockerfile.production + container_name: veza_stream_prod + restart: unless-stopped + environment: + - APP_ENV=production + - DATABASE_URL=postgres://veza:${DB_PASSWORD:-password}@postgres:5432/veza + - RABBITMQ_URL=amqp://veza:${RABBITMQ_PASSWORD:-password}@rabbitmq:5672/%2f + - LOG_DIR=/var/log/veza + - LOG_LEVEL=INFO + volumes: + - veza_logs:/var/log/veza + depends_on: + postgres: + condition: service_healthy + rabbitmq: + condition: service_healthy + ports: + - "8082:8082" + + frontend: + build: + context: ./apps/web + dockerfile: Dockerfile.production + container_name: veza_frontend_prod + restart: unless-stopped + environment: + - VITE_API_URL=http://localhost:8080/api/v1 + ports: + - "3000:80" + depends_on: + - backend + +volumes: + postgres_prod_data: + redis_prod_data: + rabbitmq_prod_data: + veza_logs: + + diff --git a/scripts/rotate_logs.sh b/scripts/rotate_logs.sh new file mode 100755 index 000000000..1177c40c1 --- /dev/null +++ b/scripts/rotate_logs.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# Script pour gérer la rotation manuelle des logs Veza +# Usage: bash scripts/rotate_logs.sh [service] +# +# Services disponibles: +# backend-api, redis, db, rabbitmq, chat-server, stream-server, all + +set -e + +LOG_DIR="/var/log/veza" +SERVICE="${1:-all}" +TIMESTAMP=$(date +%Y%m%d_%H%M%S) + +rotate_file() { + local file="$1" + local label="$2" + + if [ ! -f "$file" ]; then + echo "⚠️ Fichier $file non trouvé, ignoré" + return + fi + + local size=$(du -h "$file" | cut -f1) + echo "🔄 Rotation de $label ($size)..." + + # Créer une copie avec timestamp + cp "$file" "${file}.${TIMESTAMP}" + + # Compresser l'ancien fichier + gzip "${file}.${TIMESTAMP}" + + # Vider le fichier actuel + > "$file" + + echo "✅ $label roté vers ${file}.${TIMESTAMP}.gz" +} + +case $SERVICE in + backend-api) + rotate_file "$LOG_DIR/backend-api.log" "Backend API" + rotate_file "$LOG_DIR/backend-api-error.log" "Backend API Errors" + ;; + redis) + rotate_file "$LOG_DIR/redis.log" "Redis" + rotate_file "$LOG_DIR/redis-error.log" "Redis Errors" + ;; + db) + rotate_file "$LOG_DIR/db.log" "Database" + rotate_file "$LOG_DIR/db-error.log" "Database Errors" + ;; + rabbitmq) + rotate_file "$LOG_DIR/rabbitmq.log" "RabbitMQ" + rotate_file "$LOG_DIR/rabbitmq-error.log" "RabbitMQ Errors" + ;; + chat-server) + rotate_file "$LOG_DIR/chat-server.log" "Chat Server" + rotate_file "$LOG_DIR/chat-server-error.log" "Chat Server Errors" + ;; + stream-server) + rotate_file "$LOG_DIR/stream-server.log" "Stream Server" + rotate_file "$LOG_DIR/stream-server-error.log" "Stream Server Errors" + ;; + all) + echo "🔄 Rotation de tous les logs Veza..." + echo "" + rotate_file "$LOG_DIR/backend-api.log" "Backend API" + rotate_file "$LOG_DIR/backend-api-error.log" "Backend API Errors" + rotate_file "$LOG_DIR/redis.log" "Redis" + rotate_file "$LOG_DIR/redis-error.log" "Redis Errors" + rotate_file "$LOG_DIR/db.log" "Database" + rotate_file "$LOG_DIR/db-error.log" "Database Errors" + rotate_file "$LOG_DIR/rabbitmq.log" "RabbitMQ" + rotate_file "$LOG_DIR/rabbitmq-error.log" "RabbitMQ Errors" + rotate_file "$LOG_DIR/chat-server.log" "Chat Server" + rotate_file "$LOG_DIR/chat-server-error.log" "Chat Server Errors" + rotate_file "$LOG_DIR/stream-server.log" "Stream Server" + rotate_file "$LOG_DIR/stream-server-error.log" "Stream Server Errors" + echo "" + echo "✅ Rotation terminée!" + ;; + *) + echo "❌ Service inconnu: $SERVICE" + echo "" + echo "Services disponibles:" + echo " - backend-api" + echo " - redis" + echo " - db" + echo " - rabbitmq" + echo " - chat-server" + echo " - stream-server" + echo " - all" + exit 1 + ;; +esac + +echo "" +echo "📊 Fichiers de logs actuels:" +ls -lh "$LOG_DIR"/*.log 2>/dev/null || echo "Aucun fichier actif" +echo "" +echo "📦 Archives compressées:" +ls -lh "$LOG_DIR"/*.gz 2>/dev/null || echo "Aucune archive" diff --git a/scripts/setup_logs.sh b/scripts/setup_logs.sh new file mode 100755 index 000000000..58bfe9049 --- /dev/null +++ b/scripts/setup_logs.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# Script pour configurer le répertoire de logs Veza +# Usage: sudo bash scripts/setup_logs.sh + +set -e + +LOG_DIR="/var/log/veza" +USER="${SUDO_USER:-$USER}" + +echo "🔧 Configuration du répertoire de logs Veza..." + +# Créer le répertoire s'il n'existe pas +if [ ! -d "$LOG_DIR" ]; then + echo "📁 Création du répertoire $LOG_DIR..." + mkdir -p "$LOG_DIR" +else + echo "✅ Le répertoire $LOG_DIR existe déjà" +fi + +# Configurer les permissions +echo "🔐 Configuration des permissions..." +chown -R "$USER:$USER" "$LOG_DIR" +chmod 755 "$LOG_DIR" + +# Vérifier les permissions +echo "📋 Vérification des permissions:" +ls -ld "$LOG_DIR" + +# Créer un fichier .gitkeep pour garder le répertoire dans git +touch "$LOG_DIR/.gitkeep" + +echo "✅ Configuration terminée!" +echo "" +echo "Le répertoire $LOG_DIR est prêt à recevoir les logs." +echo "Les services Veza écriront leurs logs dans ce répertoire." +echo "" +echo "Organisation des logs:" +echo " - Backend API: backend-api.log, redis.log, db.log, rabbitmq.log" +echo " - Chat Server: chat-server.log" +echo " - Stream Server: stream-server.log" +echo " - Fichiers *-error.log contiennent uniquement les erreurs" diff --git a/scripts/view_logs.sh b/scripts/view_logs.sh new file mode 100755 index 000000000..f63ca00d7 --- /dev/null +++ b/scripts/view_logs.sh @@ -0,0 +1,151 @@ +#!/bin/bash +# Script pour visualiser les logs Veza +# Usage: bash scripts/view_logs.sh [service] [options] +# +# Services disponibles: +# backend-api, redis, db, rabbitmq, chat-server, stream-server, all +# +# Options: +# -f, --follow Suivre les logs en temps réel (tail -f) +# -e, --errors Afficher uniquement les erreurs +# -n NUM Nombre de lignes à afficher (défaut: 50) +# -g PATTERN Filtrer par pattern (grep) + +set -e + +LOG_DIR="/var/log/veza" +SERVICE="${1:-all}" +FOLLOW=false +ERRORS_ONLY=false +LINES=50 +GREP_PATTERN="" + +# Parser les options +shift || true +while [[ $# -gt 0 ]]; do + case $1 in + -f|--follow) + FOLLOW=true + shift + ;; + -e|--errors) + ERRORS_ONLY=true + shift + ;; + -n) + LINES="$2" + shift 2 + ;; + -g) + GREP_PATTERN="$2" + shift 2 + ;; + *) + echo "Option inconnue: $1" + exit 1 + ;; + esac +done + +# Fonction pour afficher les logs d'un fichier +view_log() { + local file="$1" + local label="$2" + + if [ ! -f "$file" ]; then + echo "⚠️ Fichier $file non trouvé" + return + fi + + echo "📋 === $label ===" + + if [ "$FOLLOW" = true ]; then + if [ -n "$GREP_PATTERN" ]; then + tail -f "$file" | grep --color=auto "$GREP_PATTERN" + else + tail -f "$file" + fi + else + if [ -n "$GREP_PATTERN" ]; then + tail -n "$LINES" "$file" | grep --color=auto "$GREP_PATTERN" + else + tail -n "$LINES" "$file" + fi + fi + echo "" +} + +# Déterminer quels fichiers afficher +case $SERVICE in + backend-api) + if [ "$ERRORS_ONLY" = true ]; then + view_log "$LOG_DIR/backend-api-error.log" "Backend API - Erreurs" + else + view_log "$LOG_DIR/backend-api.log" "Backend API - Tous les logs" + fi + ;; + redis) + if [ "$ERRORS_ONLY" = true ]; then + view_log "$LOG_DIR/redis-error.log" "Redis - Erreurs" + else + view_log "$LOG_DIR/redis.log" "Redis - Tous les logs" + fi + ;; + db) + if [ "$ERRORS_ONLY" = true ]; then + view_log "$LOG_DIR/db-error.log" "Database - Erreurs" + else + view_log "$LOG_DIR/db.log" "Database - Tous les logs" + fi + ;; + rabbitmq) + if [ "$ERRORS_ONLY" = true ]; then + view_log "$LOG_DIR/rabbitmq-error.log" "RabbitMQ - Erreurs" + else + view_log "$LOG_DIR/rabbitmq.log" "RabbitMQ - Tous les logs" + fi + ;; + chat-server) + if [ "$ERRORS_ONLY" = true ]; then + view_log "$LOG_DIR/chat-server-error.log" "Chat Server - Erreurs" + else + view_log "$LOG_DIR/chat-server.log" "Chat Server - Tous les logs" + fi + ;; + stream-server) + if [ "$ERRORS_ONLY" = true ]; then + view_log "$LOG_DIR/stream-server-error.log" "Stream Server - Erreurs" + else + view_log "$LOG_DIR/stream-server.log" "Stream Server - Tous les logs" + fi + ;; + all) + echo "📊 === Vue d'ensemble des logs Veza ===" + echo "" + if [ "$ERRORS_ONLY" = true ]; then + view_log "$LOG_DIR/backend-api-error.log" "Backend API - Erreurs" + view_log "$LOG_DIR/redis-error.log" "Redis - Erreurs" + view_log "$LOG_DIR/db-error.log" "Database - Erreurs" + view_log "$LOG_DIR/rabbitmq-error.log" "RabbitMQ - Erreurs" + view_log "$LOG_DIR/chat-server-error.log" "Chat Server - Erreurs" + view_log "$LOG_DIR/stream-server-error.log" "Stream Server - Erreurs" + else + echo "💡 Astuce: Utilisez -e pour voir uniquement les erreurs" + echo "" + ls -lh "$LOG_DIR"/*.log 2>/dev/null || echo "Aucun fichier de log trouvé" + fi + ;; + *) + echo "❌ Service inconnu: $SERVICE" + echo "" + echo "Services disponibles:" + echo " - backend-api" + echo " - redis" + echo " - db" + echo " - rabbitmq" + echo " - chat-server" + echo " - stream-server" + echo " - all (vue d'ensemble)" + exit 1 + ;; +esac