Struct log4rs::append::rolling_file::LogFile
source · pub struct LogFile<'a> { /* private fields */ }
Expand description
Information about the active log file.
Implementations§
source§impl<'a> LogFile<'a>
impl<'a> LogFile<'a>
sourcepub fn len(&self) -> u64
👎Deprecated since 0.9.1: Please use the len_estimate function instead
pub fn len(&self) -> u64
Returns an estimate of the log file’s current size.
This is calculated by taking the size of the log file when it is opened and adding the number of bytes written. It may be inaccurate if any writes have failed or if another process has modified the file concurrently.
sourcepub fn len_estimate(&self) -> u64
pub fn len_estimate(&self) -> u64
Returns an estimate of the log file’s current size.
This is calculated by taking the size of the log file when it is opened and adding the number of bytes written. It may be inaccurate if any writes have failed or if another process has modified the file concurrently.
sourcepub fn roll(&mut self)
pub fn roll(&mut self)
Triggers the log file to roll over.
A policy must call this method when it wishes to roll the log. The appender’s handle to the file will be closed, which is necessary to move or delete the file on Windows.
If this method is called, the log file must no longer be present on disk when the policy returns.