[][src]Struct sloggers::file::FileLoggerConfig

pub struct FileLoggerConfig {
    pub level: Severity,
    pub format: Format,
    pub source_location: SourceLocation,
    pub timezone: TimeZone,
    pub timestamp_template: String,
    pub path: PathBuf,
    pub channel_size: usize,
    pub truncate: bool,
    pub rotate_size: u64,
    pub rotate_keep: usize,
    pub rotate_compress: bool,
    pub overflow_strategy: OverflowStrategy,
}

The configuration of FileLoggerBuilder.

Fields

level: Severity

Log level.

format: Format

Log record format.

source_location: SourceLocation

Source code location

timezone: TimeZone

Time Zone.

timestamp_template: String

Format string for the timestamp in the path. The string is formatted using strftime

Default: "%Y%m%d_%H%M", example: "20180918_1127"

path: PathBuf

Log file path template.

It will be used as-is, with the following transformation:

All occurrences of the substring "{timestamp}" will be replaced with the current timestamp formatted according to timestamp_template. The timestamp will respect the timezone setting.

channel_size: usize

Asynchronous channel size

truncate: bool

Truncate the file or not

rotate_size: u64

Log file rotation size.

For details, see the documentation of rotate_size.

rotate_keep: usize

Maximum number of rotated log files to keep.

For details, see the documentation of rotate_keep.

rotate_compress: bool

Whether to compress or not compress rotated files.

For details, see the documentation of rotate_compress.

The default value is false.

overflow_strategy: OverflowStrategy

Whether to drop logs on overflow.

The possible values are drop, drop_and_report, or block.

The default value is drop_and_report.

Trait Implementations

impl Config for FileLoggerConfig[src]

type Builder = FileLoggerBuilder

Logger builder.

impl Default for FileLoggerConfig[src]

impl Clone for FileLoggerConfig[src]

impl Debug for FileLoggerConfig[src]

impl Serialize for FileLoggerConfig[src]

impl<'de> Deserialize<'de> for FileLoggerConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]