Documentation
¶
Overview ¶
Package rotation provides file rotation when files hit a given size.
Index ¶
Constants ¶
View Source
const ( DefaultMaxSize = 10 * 1024 * 1024 DefaultMaxBackups = 1 )
Constants for defaults.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
DefaultPath returns the default path that will be used. This will use cmdline.AppIdentifier (if set) to better isolate the log location.
func MaxBackups ¶
MaxBackups sets the maximum number of old log files to retain. Defaults to DefaultMaxBackups.
func MaxSize ¶
MaxSize sets the maximum size of the log file before it gets rotated. Defaults to DefaultMaxSize.
Types ¶
type Rotator ¶
type Rotator struct {
// contains filtered or unexported fields
}
Rotator holds the rotator data.
func (*Rotator) PathToLog ¶ added in v1.75.0
PathToLog returns the path to the log file that will be used.
Click to show internal directories.
Click to hide internal directories.