hook

package module
v0.0.0-...-523bf04 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: MIT Imports: 4 Imported by: 0

README

logrus-clickhouse-hook

If you set columns [level] [msg] [time], It will automatically merge raw fields value [level] [msg] [time] when saved.

Based on the modified oxgrouby/logrus-clickhouse-hook

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClickHouse

type ClickHouse struct {
	Db          string
	Table       string
	Host        string
	Port        string
	Columns     []string
	Credentials struct {
		User     string
		Password string
	}
}

type Hook

type Hook struct {
	ClickHouse *ClickHouse
	// contains filtered or unexported fields
}

func NewHook

func NewHook(clickHouse *ClickHouse) (*Hook, error)

func (*Hook) Fire

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

func (*Hook) Levels

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

func (*Hook) Save

func (hook *Hook) Save(field map[string]interface{}) error

func (*Hook) SetLevels

func (hook *Hook) SetLevels(lvs []logrus.Level)

Jump to

Keyboard shortcuts

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