This guide covers monitoring, logging, and debugging the application in production.
- Environment Setup
VITE_LOG_LEVEL=error
VITE_ENABLE_ERROR_REPORTING=true
- Log Levels
- ERROR: Critical issues
- WARN: Important warnings
- INFO: General information
- DEBUG: Detailed debugging
Errors are stored in the error_reports
table with:
- Source
- Error code
- Message
- Stack trace
- User context
- Timestamp
- Health Checks
# Check application health
curl http://localhost/health
# View container health
docker ps --format "{{.Names}}: {{.Status}}"
- Resource Monitoring
# View resource usage
docker stats
# Check memory usage
docker system df
- View Error Logs
# Recent errors
npm run logs:errors
# Full error history
npm run logs:all
- Error Statistics
# Error rate by source
npm run stats:errors
# Error trends
npm run stats:trends
- Enable Debug Mode
await debugManager.saveConfig({
enabled: true,
logLevel: 'debug',
showInConsole: true
});
- Debug Panel
- View system status
- Monitor API calls
- Track performance
- Debug storage operations
- Enable Production Logs
# Enable detailed logging
docker-compose -f docker-compose.prod.yml logs -f
# Filter by service
docker-compose logs app | grep ERROR
- Performance Monitoring
# View slow queries
npm run db:analyze
# Check API performance
npm run api:stats
- Setup Alerts
// Error rate threshold
const ERROR_THRESHOLD = 0.05;
// Response time threshold
const RESPONSE_THRESHOLD = 1000;
- Alert Channels
- Email notifications
- Discord webhooks
- Admin dashboard
- Error Alerts
- High error rate
- Critical errors
- Security issues
- Performance Alerts
- Slow responses
- High resource usage
- API failures
- Technical Support: [email protected]
- Emergency: [email protected]
- Status Page: status.example.com