hubcio commented on code in PR #2452:
URL: https://github.com/apache/iggy/pull/2452#discussion_r2652320252
##########
core/server/src/configs/system.rs:
##########
@@ -88,12 +88,26 @@ pub struct LoggingConfig {
pub level: String,
pub file_enabled: bool,
pub max_size: IggyByteSize,
+ #[serde(default = "default_max_total_log_size")]
+ pub max_total_size: IggyByteSize,
+ #[serde(default = "default_log_rotation_check_interval")]
+ pub rotation_check_interval: u64,
#[serde_as(as = "DisplayFromStr")]
pub retention: IggyDuration,
#[serde_as(as = "DisplayFromStr")]
pub sysinfo_print_interval: IggyDuration,
}
+fn default_max_total_log_size() -> IggyByteSize {
+ IggyByteSize::from(4_000_000_000)
+ // 4 GB by default
+}
+
+fn default_log_rotation_check_interval() -> u64 {
+ 3600
+ // 1 hour by default
+}
Review Comment:
this is not how we do the defaults, we use values from actual config in repo
and you already did it, so you can remove these, along with lines 91 and 93.
##########
core/server/src/configs/system.rs:
##########
@@ -88,12 +88,26 @@ pub struct LoggingConfig {
pub level: String,
pub file_enabled: bool,
pub max_size: IggyByteSize,
+ #[serde(default = "default_max_total_log_size")]
+ pub max_total_size: IggyByteSize,
+ #[serde(default = "default_log_rotation_check_interval")]
+ pub rotation_check_interval: u64,
#[serde_as(as = "DisplayFromStr")]
pub retention: IggyDuration,
#[serde_as(as = "DisplayFromStr")]
pub sysinfo_print_interval: IggyDuration,
}
+fn default_max_total_log_size() -> IggyByteSize {
+ IggyByteSize::from(4_000_000_000)
+ // 4 GB by default
+}
+
+fn default_log_rotation_check_interval() -> u64 {
+ 3600
+ // 1 hour by default
+}
Review Comment:
this is not how we do the defaults, we use values from actual config in repo
- you already did it, so you can remove these, along with lines 91 and 93.
--
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]