Categorygithub.com/zhangjie2012/logrus-hook
modulepackage
0.0.1
Repository: https://github.com/zhangjie2012/logrus-hook.git
Documentation: pkg.go.dev

# README

logrus-hook

Go logrus hooks.

go get github.com/zhangjie2012/logrus-hook

Redis LIST

log write(RPUSH) to redis LIST.

option := RedisOption{
    Addr:     "localhost:6379",
    Password: "",
    DB:       0,
    Key:      "logrusredis.hook",
}
hook, _ := NewRedisHook("application_name", &option, nil)
logrus.AddHook(hook)

Customize

If you want customize inserted redis bs, you can customize a LogWashFunc, checkout redishook_test.go file.

# Functions

DefaultLogWashFunc log filter and serialization - use msgpack serialize log - level > 'DEBUG' - set current instance ip.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author

# Type aliases

LogWashFunc log struct to bytes.