eslogrus

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 11 Imported by: 0

README

eslogrus

Elasticsearch v7 hook for Logrus

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotCreateIndex = fmt.Errorf("cannot create index")
)

Functions

This section is empty.

Types

type ElasticHook

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

func NewElasticHook

func NewElasticHook(client *elasticsearch.Client, host string, levels []logrus.Level, index string) (*ElasticHook, error)

NewElasticHook creates new hook. client - ElasticSearch client host - host of system levels - log levels to log index - name of the index in ElasticSearch

func (*ElasticHook) Cancel

func (hook *ElasticHook) Cancel()

Cancel all calls to elastic

func (*ElasticHook) Fire

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

func (*ElasticHook) Levels

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

Levels Required for logrus hook implementation

type IndexNameFunc

type IndexNameFunc func() string

Jump to

Keyboard shortcuts

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