diff --git a/tracing-appender/src/rolling/builder.rs b/tracing-appender/src/rolling/builder.rs index 8c92ca1238..b53e61fab3 100644 --- a/tracing-appender/src/rolling/builder.rs +++ b/tracing-appender/src/rolling/builder.rs @@ -228,7 +228,7 @@ impl Builder { #[must_use] pub fn max_log_files(self, n: usize) -> Self { Self { - max_files: Some(n), + max_files: Some(n).filter(|&n| n > 0), ..self } }