Documentation
¶
Overview ¶
Package introtator provides an interface for Rotatorr that renames backup log files with an incrementing integer in the name. By default rotated log files are named: service.1.log.
Control the order of integers with Layout.FileOrder.
In Ascending mode, the current file is always rotated to `.1`, and all the files in the way are rotated first. In Descending mode the existing files are pruned, then files are rotated down and lastly the current file is rotated to the next highest integer.
Index ¶
Constants ¶
const ( LogExt = ".log" // suffixed to an integer. LogExt1 = "1.log" // suffixed to the prefix. GZext = ".gz" // trimmed off found files. Joiner = "." // joins prefix with integer. )
Some constant this package uses.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layout ¶
type Layout struct { ArchiveDir string // Location where rotated backup logs are moved to. FileCount int // Maximum number of rotated log files. FileOrder Order // Control the order of the integer-named backup log files. PostRotate func(fileName, newFile string) filer.Filer }
Layout defines how integer-stamped backup logs have their file names decided. This also sets how many files are kept; default is unlimited. Recommend setting FileCount when FileOrder is set to Ascending (default), otherwise the app may spend a lot of time renaming files. If you enable compression with a PostRotate hook, make sure compression finishes before the files are rotated.
func (*Layout) Dirs ¶
Dirs checks our config and returns the folder for rotatorr library to create them.