Documentation ¶
Index ¶
- Constants
- Variables
- func Location() *time.Location
- func NewRotateLogger(config *Config) (*rotateLogs.RotateLogs, error)
- func NewWriter(opts ...Option) (io.Writer, error)
- type Config
- type Option
- func WithAge(Age time.Duration) Option
- func WithCount(Count uint) Option
- func WithDuration(Duration time.Duration) Option
- func WithFileMode(Perm os.FileMode) Option
- func WithFilename(fn string) Option
- func WithLocation(loc *time.Location) Option
- func WithLogDir(dir string) Option
- func WithLogSubDir(dir string) Option
- func WithPattern(Pattern string) Option
Constants ¶
Variables ¶
Functions ¶
func NewRotateLogger ¶
func NewRotateLogger(config *Config) (*rotateLogs.RotateLogs, error)
Types ¶
type Config ¶
type Config struct { Dir string Sub string Filename string Perm os.FileMode Age time.Duration Duration time.Duration Pattern string Count uint Loc *time.Location }
func NewWriterConfig ¶
func NewWriterConfig() *Config
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithCount ¶
sets the number of files should be kept before it gets purged from the file system.
func WithDuration ¶
func WithFileMode ¶
func WithFilename ¶
func WithLocation ¶
func WithLogDir ¶
func WithLogSubDir ¶
func WithPattern ¶
Directories ¶
Path | Synopsis |
---|---|
package rotatelogs is a port of File-RotateLogs from Perl (https://metacpan.org/release/File-RotateLogs), and it allows you to automatically rotate output files when you write to them according to the filename pattern that you can specify.
|
package rotatelogs is a port of File-RotateLogs from Perl (https://metacpan.org/release/File-RotateLogs), and it allows you to automatically rotate output files when you write to them according to the filename pattern that you can specify. |
Click to show internal directories.
Click to hide internal directories.