Svecco commented on code in PR #2452:
URL: https://github.com/apache/iggy/pull/2452#discussion_r2636795164


##########
core/server/src/log/logger.rs:
##########
@@ -253,8 +255,48 @@ impl Logging {
             let base_directory = PathBuf::from(base_directory);
             let logs_subdirectory = PathBuf::from(config.path.clone());
             let logs_path = base_directory.join(logs_subdirectory.clone());
-            let file_appender =
-                tracing_appender::rolling::hourly(logs_path.clone(), 
IGGY_LOG_FILE_PREFIX);
+
+            if let Err(e) = std::fs::create_dir_all(&logs_path) {
+                tracing::warn!("Failed to create logs directory {:?}: {}", 
logs_path, e);
+                return Err(LogError::FileReloadFailure);
+            }
+
+            // Check available disk space (at least 10MB)
+            let min_disk_space: u64 = 10 * 1024 * 1024; // 10MB
+            if let Ok(available_space) = fs2::available_space(&logs_path) {
+                if available_space < min_disk_space {
+                    tracing::warn!(

Review Comment:
   Now `warn!` `debug!` and `error` have been imported.



-- 
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]

Reply via email to