eslogrus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticHook

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

ElasticHook is a logrus hook for ElasticSearch

func NewElasticHook

func NewElasticHook(client *elastic.Client, host string, level logrus.Level, index string) (*ElasticHook, error)

NewElasticHook 新建一个es hook对象

func NewElasticHookWithFunc

func NewElasticHookWithFunc(client *elastic.Client, host string, level logrus.Level, indexFunc IndexNameFunc) (*ElasticHook, error)

func (*ElasticHook) Fire

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

Fire 实现 logrus hook 必须要的接口函数

func (*ElasticHook) Levels

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

Levels 实现 logrus hook 必须要的接口函数

type IndexNameFunc

type IndexNameFunc func() string

IndexNameFunc get index name

Jump to

Keyboard shortcuts

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