Skip to content

Commit

Permalink
Merge pull request #296 from stakwork/local-log-config
Browse files Browse the repository at this point in the history
per-container logging config to local with maxes
  • Loading branch information
Evanfeenstra authored Sep 11, 2024
2 parents 3fbd04e + ff6d75b commit 368f47a
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 368f47a

Please sign in to comment.