pub struct LogWriterConfig {
pub log_dir: Utf8PathBuf,
pub max_file_size: u64,
pub compression_level: i32,
pub max_segment_duration: Option<Duration>,
pub suffix: Option<String>,
pub tz: Option<Tz>,
}Expand description
Configuration for constructing a LogWriter.
Fields§
§log_dir: Utf8PathBufDirectory where log segment files will be created.
max_file_size: u64Maximum number of uncompressed bytes written per segment before rolling to a new file.
compression_level: i32Zstd compression level.
max_segment_duration: Option<Duration>If set, the segment will be closed after this duration even if max_file_size has not been reached.
suffix: Option<String>Optional suffix appended to segment file names.
tz: Option<Tz>Timezone used when computing the segment file name. Defaults to UTC.
Implementations§
Source§impl LogWriterConfig
impl LogWriterConfig
pub fn new(log_dir: Utf8PathBuf) -> Self
pub fn max_file_size(self, size: u64) -> Self
pub fn compression_level(self, level: i32) -> Self
pub fn max_segment_duration(self, duration: Duration) -> Self
pub fn suffix(self, suffix: impl Into<String>) -> Self
pub fn tz(self, tz: Tz) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogWriterConfig
impl<'de> Deserialize<'de> for LogWriterConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LogWriterConfig
impl RefUnwindSafe for LogWriterConfig
impl Send for LogWriterConfig
impl Sync for LogWriterConfig
impl Unpin for LogWriterConfig
impl UnwindSafe for LogWriterConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more