Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextHook ¶
type ContextHook struct {
// contains filtered or unexported fields
}
ContextHook represents a hook for logrus logger.
func NewContextHook ¶
func NewContextHook(contextKey interface{}, fn func(entry *log.Entry, ctxValue interface{})) *ContextHook
NewContextHook creates a new ContextHook instance
func (*ContextHook) Fire ¶
func (hook *ContextHook) Fire(entry *logrus.Entry) error
Fire implements logrus.ContextHook.Fire()
func (*ContextHook) Levels ¶
func (hook *ContextHook) Levels() []logrus.Level
Levels implements logrus.ContextHook.Levels()
type ContextHookFormatFn ¶
ContextHookFormatFn is the callback function for formating message
type FileHook ¶
type FileHook struct {
// contains filtered or unexported fields
}
FileHook is a hook to handle writing to local log files.
func NewFileHook ¶
NewFileHook returns new FileHook instance with default values.
func (*FileHook) SetFormatter ¶
SetFormatter sets the format that will be used by hook.
func (*FileHook) SetMaxAge ¶
SetMaxAge sets the maximum duration to retain old log files based on the timestamp encoded in their filename.
func (*FileHook) SetMaxSize ¶
SetMaxSize sets the maximum size in megabytes of the log file before it gets rotated.
Click to show internal directories.
Click to hide internal directories.