#[non_exhaustive]pub struct FileLoggerConfig {Show 13 fields
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,
pub restrict_permissions: bool,
}Expand description
The configuration of FileLoggerBuilder.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.level: SeverityLog level.
format: FormatLog record format.
source_location: SourceLocationSource code location
timezone: TimeZoneTime Zone.
timestamp_template: StringFormat string for the timestamp in the path. The string is formatted using strftime
Default: “%Y%m%d_%H%M”, example: “20180918_1127”
path: PathBufLog 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: usizeAsynchronous channel size
truncate: boolTruncate the file or not
rotate_size: u64Log file rotation size.
For details, see the documentation of rotate_size.
rotate_keep: usizeMaximum number of rotated log files to keep.
For details, see the documentation of rotate_keep.
rotate_compress: boolWhether to compress or not compress rotated files.
For details, see the documentation of rotate_compress.
The default value is false.
overflow_strategy: OverflowStrategyWhether to drop logs on overflow.
The possible values are drop, drop_and_report, or block.
The default value is drop_and_report.
restrict_permissions: boolWhether to restrict the permissions of log files.
For details, see the documentation of [restict_permissions].
Implementations§
Trait Implementations§
Source§impl Clone for FileLoggerConfig
impl Clone for FileLoggerConfig
Source§fn clone(&self) -> FileLoggerConfig
fn clone(&self) -> FileLoggerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more