redis_hook

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateZapOriginLogMessage

func CreateZapOriginLogMessage(entry *zapcore.Entry, data map[string]interface{}) map[string]interface{}

zap need extra data for fields

Types

type HookConfig

type HookConfig struct {
	Key      string
	Host     string
	Password string
	Port     int
	TTL      int
}

HookConfig stores configuration needed to setup the hook

type RedisHook

type RedisHook struct {
	RedisPool      *redis.Pool
	RedisHost      string
	RedisKey       string
	LogstashFormat string
	AppName        string
	Hostname       string
	RedisPort      int
	TTL            int
}

RedisHook to sends logs to Redis server

func NewHook

func NewHook(config HookConfig) (redisHook *RedisHook, err error)

NewHook creates a hook to be added to an instance of logger

Jump to

Keyboard shortcuts

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