SinkConfig

Struct SinkConfig 

Source
pub struct SinkConfig {
Show 16 fields pub path: Option<PathBuf>, pub rotation: Option<String>, pub size_limit: Option<u64>, pub retention: Option<usize>, pub filter_min_level: Option<Level>, pub filter_module: Option<String>, pub filter_function: Option<String>, pub async_write: bool, pub buffer_size: usize, pub flush_interval: u64, pub max_buffered_lines: usize, pub date_style: Option<String>, pub date_enabled: bool, pub format: Option<String>, pub json: bool, pub color: bool,
}
Expand description

Configuration for a log sink.

Defines all settings for a single output destination including path, rotation, filtering, formatting, and performance options.

Fields§

§path: Option<PathBuf>

File path (None = console output)

§rotation: Option<String>

Rotation interval: “hourly”, “daily”, “weekly”, “monthly”, “yearly”

§size_limit: Option<u64>

Maximum file size before rotation (bytes)

§retention: Option<usize>

Number of rotated files to keep (None = unlimited)

§filter_min_level: Option<Level>

Minimum log level to accept

§filter_module: Option<String>

Filter by module name

§filter_function: Option<String>

Filter by function name

§async_write: bool

Enable async writes (recommended for file sinks)

§buffer_size: usize

Write buffer size in bytes

§flush_interval: u64

Flush interval in milliseconds

§max_buffered_lines: usize

Maximum number of buffered log records

§date_style: Option<String>

Custom date/time format pattern

§date_enabled: bool

Enable timestamp in output

§format: Option<String>

Custom format template string

§json: bool

Enable JSON output format

§color: bool

Enable ANSI color codes

Trait Implementations§

Source§

impl Default for SinkConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.