Struct sloggers::file::FileLoggerBuilder [−][src]
pub struct FileLoggerBuilder { /* fields omitted */ }
Expand description
A logger builder which build loggers that write log records to the specified file.
The resulting logger will work asynchronously (the default channel size is 1024).
Implementations
Makes a new FileLoggerBuilder
instance.
This builder will create a logger which uses path
as
the output destination of the log records.
Sets the source code location type this logger will use.
Sets the overflow strategy for the logger.
Sets the time zone which this logger will use.
Sets the size of the asynchronous channel of this logger.
Sets KVFilter
.
By default, logger just appends log messages to file. If this method called, logger truncates the file to 0 length when opening.
Sets the threshold used for determining whether rotate the current log file.
If the byte size of the current log file exceeds this value, the file will be rotated.
The name of the rotated file will be "${ORIGINAL_FILE_NAME}.0"
.
If there is a previously rotated file,
it will be renamed to "${ORIGINAL_FILE_NAME}.1"
before rotation of the current log file.
This process is iterated recursively until log file names no longer conflict or
rotate_keep
limit reached.
The default value is std::u64::MAX
.
Sets the maximum number of rotated log files to keep.
If the number of rotated log files exceed this value, the oldest log file will be deleted.
The default value is 8
.
Sets whether to compress or not compress rotated files.
If true
is specified, rotated files will be compressed by GZIP algorithm and
the suffix “.gz” will be appended to those file names.
The default value is false
.
Sets whether the log files should have restricted permissions.
If true
is specified, new log files will be created with the 600
octal permission
on unix systems.
On Windows systems, new log files will have an ACL which just contains the SID of
the owner.
The default value is false
.