# Logging Example and Configuration ## Logging Features Implemented ### 1. Centralized Logging Configuration - **File**: `config/logging_config.py` - **Features**: - Rotating file logs (10MB max, 5 backups) - Console and file output - Structured format with timestamps, levels, and source location - Environment-based configuration ### 2. Service-Level Logging - **Vector Store Service**: Logs initialization, document loading, provider setup - **LLM Service**: Logs model setup, question processing, memory operations - **API Endpoints**: Logs requests, responses, and errors ### 3. Log Levels Used - **INFO**: Normal operations, successful completions - **DEBUG**: Detailed operation steps, memory operations - **WARNING**: Non-critical issues, fallbacks - **ERROR**: Failures, exceptions (with stack traces) ### 4. Emoji-Coded Log Messages - 🚀 Startup/Initialization - ✅ Success operations - ❌ Error conditions - ⚠️ Warning conditions - 🔧 Configuration/Setup - 💬 Chat operations - 🧠 Memory operations - 📊 Database operations - 🔍 Search/Retrieval - 💾 Storage operations ## Usage Examples ```python from config.logging_config import get_logger # Get a logger for your module logger = get_logger("my_module") # Log at different levels logger.info("✅ Operation completed successfully") logger.warning("⚠️ Using fallback configuration") logger.error("❌ Operation failed", exc_info=True) # Includes stack trace ``` ## Log File Location - **Path**: `./logs/recipe_bot.log` - **Rotation**: Automatic when file exceeds 10MB - **Backups**: Keeps 5 backup files ## Console Output All logs are also displayed in the console with colored formatting for easy debugging during development.