Environment Variables
Configure logging behavior with these environment variables:Log Files
The system automatically creates these log files in thelogs/
directory:
File | Purpose | Rotation | Retention |
---|---|---|---|
gaia-{date}.log | General application logs | Daily | 30 days |
errors-{date}.log | Errors and critical issues | 10MB | 90 days |
structured-{date}.json | Machine-readable JSON logs | 50MB | 60 days |
critical-{date}.log | Critical issues only | 1MB | 1 year |
performance-{date}.log | Performance logs (filtered) | 20MB | 7 days |
Usage
Using Pre-configured Loggers
Creating Contextual Loggers
Function Logging Decorator
Custom Log Levels
Three custom levels are available with special formatting:- PERFORMANCE ⚡ - Performance metrics and timing
- AUDIT 📊 - Audit trail events
- SECURITY 🔒 - Security-related events
Production Tips
- Set
LOG_LEVEL=INFO
orWARNING
in production to reduce verbosity - Use
LOG_DIAGNOSE=false
in production for security - Monitor log file sizes and rotation policies
- Parse structured JSON logs for monitoring and analysis