pub struct FileWriter {
pub directory_path: String,
pub file_name: String,
pub file_ext: Option<String>,
pub max_log_files: Option<usize>,
pub rotation: Option<FileRotation>,
pub non_blocking: NonBlockingOptions,
}Expand description
A file Writer
§Example
# declare a writer named "my_file"
[writer.my_file]
type = "file"
directory_path = "${env:fs_app_logs}/rust/" # ${env:fs_app_logs} there should be an environment variable named "fs_app_logs"
file_name = "util"
# The following are optional
file_ext = "log" # filename will end in .log
max_log_files = 50 # keep at most 50 log files
rotation = "daily" # possible values are : "minutely", "hourly", "daily", "never"
# The following are optional and only related to non blocking
non_blocking = true # async
buffered_lines_limit = 2048 # lines buffer
lossy = false # no loss of information/logs
thread_name = "my_file_async_thread"Fields§
§directory_path: StringMust point to an existing directory on the file system
file_name: StringThe name of the tracing file without file extension
file_ext: Option<String>The file extension without the . (dot)
max_log_files: Option<usize>The maximum number of log/tracing files inside of directory_path for this writer.
Only valid if FileRotation is not Never
rotation: Option<FileRotation>File rotation options
non_blocking: NonBlockingOptionsNon blocking options
Trait Implementations§
Source§impl Clone for FileWriter
impl Clone for FileWriter
Source§fn clone(&self) -> FileWriter
fn clone(&self) -> FileWriter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileWriter
impl Debug for FileWriter
Source§impl<'de> Deserialize<'de> for FileWriter
impl<'de> Deserialize<'de> for FileWriter
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
Source§impl PartialEq for FileWriter
impl PartialEq for FileWriter
Source§fn eq(&self, other: &FileWriter) -> bool
fn eq(&self, other: &FileWriter) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FileWriter
impl Serialize for FileWriter
impl Eq for FileWriter
impl StructuralPartialEq for FileWriter
Auto Trait Implementations§
impl Freeze for FileWriter
impl RefUnwindSafe for FileWriter
impl Send for FileWriter
impl Sync for FileWriter
impl Unpin for FileWriter
impl UnsafeUnpin for FileWriter
impl UnwindSafe for FileWriter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.