Skip to content

zhangjie2012/logrus-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.