logrus2loki

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: MIT Imports: 5 Imported by: 0

README

logrus-loki-hook

Hook for logrus for Loki

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL                string
	Labels             map[string]string
	LevelName          string
	BatchWait          time.Duration
	BatchEntriesNumber int
}

Config defines configuration for hook for Loki

type Hook

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

func NewHook

func NewHook(c *Config) (*Hook, error)

NewHook creates a new hook for Loki

func (*Hook) Fire

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

Fire implements interface for logrus

func (*Hook) Levels

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

Levels retruns supported levels

Jump to

Keyboard shortcuts

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