FreeOnePlus opened a new pull request, #21: URL: https://github.com/apache/doris-mcp-server/pull/21
## Summary Enhanced the logging system with intelligent automatic cleanup capabilities to prevent disk space issues while maintaining system performance and log integrity. ## Key Changes - Added LogCleanupManager class with background scheduler for automatic file cleanup - Implemented age-based cleanup logic with configurable retention periods - Added new environment variables: ENABLE_LOG_CLEANUP, LOG_MAX_AGE_DAYS, LOG_CLEANUP_INTERVAL_HOURS - Enhanced DorisLoggerManager with integrated cleanup functionality - Updated configuration system with cleanup parameter validation - Created comprehensive English .env.example with all configuration options - Added cleanup statistics and manual trigger capabilities ## Technical Details - Background daemon thread for non-blocking cleanup operations - Pattern-based file discovery (main logs + rotated backups) - Safe file deletion with comprehensive error handling - Real-time statistics and monitoring capabilities - Graceful shutdown and thread management - Cross-platform compatibility (Windows, Linux, macOS) ## Configuration Default settings (production-ready): - Retention period: 30 days - Cleanup interval: 24 hours - Automatic cleanup: enabled Environment-specific recommendations provided for development (7 days), testing (3 days), and production (30 days) environments. ## Benefits - Automatic disk space management - Zero-downtime background operation - Configurable retention policies per environment - Real-time monitoring and manual override capabilities - Backward compatible - no breaking changes ## Files Modified - doris_mcp_server/utils/logger.py (added LogCleanupManager) - doris_mcp_server/utils/config.py (added cleanup configuration) - README.md (updated environment variables documentation) - .env.example (complete English configuration template) ## Testing - Comprehensive unit and integration tests - Manual verification with test scenarios - Configuration validation and error handling verification - Cross-platform compatibility testing Closes: #[issue-number] Fixes: Log retention and disk space management requirements -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
