Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRotateFileHook ¶
func NewRotateFileHook(config *RotateFileConfig) logrus.Hook
func NewRotateLogHook ¶
func NewRotateLogHook(config *RotateLogConfig) logrus.Hook
Types ¶
type CustomFormatter ¶
type RotateFileConfig ¶
type RotateFileConfig struct { MaxSize int // default to 100 megabytes MaxAge int // default not to remove old log MaxBackups int // default to retain all old log files LocalTime bool // default to use UTC time Compress bool // default not to perform compression Filename string // log filename (with filepath, filename and extension) Level logrus.Level // log level Formatter logrus.Formatter // text formatter }
RotateFileHook's config
type RotateFileHook ¶
type RotateFileHook struct {
// contains filtered or unexported fields
}
Write log into files (split logs to files manually)
func (*RotateFileHook) Levels ¶
func (r *RotateFileHook) Levels() []logrus.Level
type RotateLogConfig ¶
type RotateLogConfig struct { MaxAge time.Duration // default to one week RotationTime time.Duration // default to one day LocalTime bool // default to false (UTC) ForceNewFile bool // force to create a new file to record log Filepath string // log filepath Filename string // log filename, without extension Level logrus.Level // log level Formatter logrus.Formatter // text formatter }
RotateLogHook's config
type RotateLogHook ¶
type RotateLogHook struct {
// contains filtered or unexported fields
}
Write log into files (split logs to files automatically)
func (*RotateLogHook) Levels ¶
func (r *RotateLogHook) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.