hooks

package
Version: v1.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileHook added in v1.2.2

func NewFileHook(options logrus_mate.Options) (hook logrus.Hook, err error)

NewLogstashHook hook configuration

func NewLogstashHook

func NewLogstashHook(options logrus_mate.Options) (hook logrus.Hook, err error)

NewLogstashHook hook configuration

Types

type FileHookConfig added in v1.2.2

type FileHookConfig struct {
	FilePath   string `json:"file_path"` //"/var/log/misc.log"
	MaxSize    int    `json:"maxsize"`
	MaxBackups int    `json:"maxbackups"`
	MaxAge     int    `json:"maxage"`
}

LogstashHookConfig configuration struct

type LogstashHookConfig

type LogstashHookConfig struct {
	AppName          string        `json:"app_name"`
	Protocol         string        `json:"protocol"`
	Address          string        `json:"address"`
	AlwaysSentFields logrus.Fields `json:"always_sent_fields"`
	Prefix           string        `json:"prefix"`
}

LogstashHookConfig configuration struct

type LumberjackHook added in v1.2.2

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

LumberjackHook stores the configuration of the hook

func NewLumberjackHook added in v1.2.2

func NewLumberjackHook(logger *lumberjack.Logger) (*LumberjackHook, error)

NewLumberjackHook creates a new LumberjackHook

func (*LumberjackHook) Fire added in v1.2.2

func (hook *LumberjackHook) Fire(entry *logrus.Entry) error

Fire is called when a log event is fired.

func (*LumberjackHook) Levels added in v1.2.2

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

Levels returns the available logging levels

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL