loghook

package module
v0.0.0-...-eac3bf8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

logrus-log-hook

Logrus Aliyun Log Service hook

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AccessKeyId     string
	AccessKeySecret string
	Endpoint        string
	Project         string
	Logstore        string
	UserAgent       string
	Source          string
	Tags            map[string]string
	Levels          []logrus.Level
	BatchSize       uint32
	BatchInterval   time.Duration
	BufferSize      int
	MaxAttempts     int
}

Config represents the configuration for creating Log Service client.

type Hook

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

Hook represents the asynchronous Logrus hook to Log Service.

func NewHook

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

NewHook create a new async Log Service hook.

func (*Hook) Fire

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

func (*Hook) Flush

func (hook *Hook) Flush()

func (*Hook) Levels

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

Levels returns logging level to fire this hook.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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