func NewFSHook(infoPath, warnPath, errorPath string, formatter log.Formatter, rotSched RotationScheduler) log.Hook
NewFSHook makes a logging hook that writes formatted log entries to info, warn and error log files. Each log file contains the messages with that severity or higher. If a formatter is not specified, they will be logged using a JSON formatter. If a RotationScheduler is set, the files will be cycled according to its rules.
type DailyRotationSchedule struct { GZip bool // contains filtered or unexported fields }
DailyRotationSchedule rotates log files daily. Logs are only rotated when midnight passes *whilst the process is running*. E.g: if you run the process on Day 4 then stop it and start it on Day 7, no rotation will occur when the process starts.
func (rs *DailyRotationSchedule) ShouldGZip() bool
func (rs *DailyRotationSchedule) ShouldRotate() (bool, string)
type RotationScheduler interface { // ShouldRotate returns true if the file should be rotated. The suffix to apply // to the filename is returned as the 2nd arg. ShouldRotate() (bool, string) // ShouldGZip returns true if the file should be gzipped when it is rotated. ShouldGZip() bool }
RotationScheduler determines when files should be rotated.