We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
0
max_files
1 parent 5e541d9 commit ac5d5afCopy full SHA for ac5d5af
tracing-appender/src/rolling/builder.rs
@@ -195,7 +195,7 @@ impl Builder {
195
/// the maximum, so if you need to retain `m` log files, specify a max of
196
/// `m + 1`.
197
///
198
- /// If no value is supplied, the `RollingAppender` will not remove any files.
+ /// If `0` is supplied, the `RollingAppender` will not remove any files.
199
200
/// Files are considered candidates for deletion based on the following
201
/// criteria:
@@ -232,6 +232,7 @@ impl Builder {
232
#[must_use]
233
pub fn max_log_files(self, n: usize) -> Self {
234
Self {
235
+ // Setting `n` to 0 will disable the max files (effectively make it infinite).
236
max_files: Some(n).filter(|&n| n > 0),
237
..self
238
}
0 commit comments