Skip to content

Commit

Permalink
per-container logging config to local with maxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Evanfeenstra committed Sep 11, 2024
1 parent 8d58c3e commit ff6d75b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub fn host_config(
name: Some(RestartPolicyNameEnum::ON_FAILURE),
maximum_retry_count: None,
}),
log_config: local_log_config(),
..Default::default()
};
if let Some(ml) = mem_limit {
Expand All @@ -46,6 +47,16 @@ pub fn host_config(
Some(hc)
}

fn local_log_config() -> Option<HostConfigLogConfig> {
let mut h = HashMap::new();
h.insert("max-size".to_string(), "10m".to_string());
h.insert("max-file".to_string(), "5".to_string());
Some(HostConfigLogConfig {
typ: Some("local".to_string()),
config: Some(h),
})
}

pub fn manual_host_config(
ports: Vec<String>,
vols: Option<Vec<String>>,
Expand Down

0 comments on commit ff6d75b

Please sign in to comment.