rotate

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHook

func NewHook(config Config) (logrus.Hook, error)

NewHook builds a new rotate file hook.

Types

type Config

type Config struct {
	Filename   string
	MaxSize    int
	MaxBackups int
	MaxAge     int
	Level      logrus.Level
	Formatter  logrus.Formatter
}

Config is the configuration for the rotate file hook.

type File

type File struct {
	// contains filtered or unexported fields
}

File represents the rotate file hook.

func (*File) Fire

func (hook *File) Fire(entry *logrus.Entry) (err error)

Fire is called by logrus when it is about to write the log entry.

func (*File) Levels

func (hook *File) Levels() []logrus.Level

Levels determines log levels that for which the logs are written.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL