pub struct RotatingFileOutput { /* private fields */ }Expand description
Rotating file output that creates new files when size limit is reached.
Implementations§
Source§impl RotatingFileOutput
impl RotatingFileOutput
Sourcepub fn new<P: AsRef<Path>>(
base_path: P,
max_size: u64,
max_files: u32,
json_format: bool,
) -> Result<Self>
pub fn new<P: AsRef<Path>>( base_path: P, max_size: u64, max_files: u32, json_format: bool, ) -> Result<Self>
Creates a new rotating file output.
Files are rotated when they exceed max_size bytes. Old files are numbered
(e.g., app.log.1, app.log.2) and the oldest is deleted when max_files is reached.
§Arguments
base_path- Base path for log filesmax_size- Maximum file size in bytes before rotationmax_files- Maximum number of rotated files to keepjson_format- If true, writes JSON; otherwise plain text
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RotatingFileOutput
impl !UnwindSafe for RotatingFileOutput
impl Freeze for RotatingFileOutput
impl Send for RotatingFileOutput
impl Sync for RotatingFileOutput
impl Unpin for RotatingFileOutput
impl UnsafeUnpin for RotatingFileOutput
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