Documentation
¶
Overview ¶
Package file provides log file output with rotation using lumberjack.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigToUrl ¶
ConfigToUrl converts an Output configuration to a URL.
func NewFileWriter ¶
func NewFileWriter(r Output) io.WriteCloser
NewFileWriter creates a new log file writer with rotation.
Types ¶
type Output ¶
type Output struct {
// File is the path to the log file.
File string
// MaxSizeMb is the maximum file size in megabytes before rotation.
MaxSizeMb int
// MaxDays is the maximum number of days to retain old log files.
MaxDays int
// MaxBackups is the maximum number of old log files to retain.
MaxBackups int
// Compress enables compression of rotated log files.
Compress bool
}
Output configures log file rotation.
Click to show internal directories.
Click to hide internal directories.