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


##########
core/server/src/log/logger.rs:
##########
@@ -397,26 +444,199 @@ impl Logging {
         Format::default().with_thread_names(true)
     }
 
-    fn _install_log_rotation_handler(&self) {
-        todo!("Implement log rotation handler based on size and retention 
time");
-    }
-
     fn print_build_info() {
         if option_env!("IGGY_CI_BUILD") == Some("true") {
             let hash = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown");
             let built_at = 
option_env!("VERGEN_BUILD_TIMESTAMP").unwrap_or("unknown");
             let rust_version = 
option_env!("VERGEN_RUSTC_SEMVER").unwrap_or("unknown");
             let target = 
option_env!("VERGEN_CARGO_TARGET_TRIPLE").unwrap_or("unknown");
             info!(
-                "Version: {VERSION}, hash: {}, built at: {} using rust 
version: {} for target: {}",
-                hash, built_at, rust_version, target
+                "Version: {VERSION}, hash: {hash}, built at: {built_at} using 
rust version: {rust_version} for target: {target}"
             );
         } else {
             info!(
                 "It seems that you are a developer. Environment variable 
IGGY_CI_BUILD is not set to 'true', skipping build info print."
             )
         }
     }
+
+    fn calculate_max_files(max_total_size_bytes: u64, max_file_size_bytes: 
u64) -> usize {
+        if max_file_size_bytes == 0 {
+            return 10;
+        }
+
+        let max_files = max_total_size_bytes / max_file_size_bytes;
+        max_files.clamp(1, 1000) as usize
+    }
+
+    fn _install_log_rotation_handler(&self, config: &LoggingConfig, logs_path: 
Option<&PathBuf>) {

Review Comment:
   Filtering file names iggy-server.log, which is been writing.



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