import (
"github.com/Sirupsen/logrus"
"github.com/evalphobia/logrus_fluent"
)
func main() {
hook := logrus_fluent.NewHook("localhost", 24224)
hook.SetLevels([]logrus.Level{
logrus.PanicLevel,
logrus.ErrorLevel,
})
logrus.AddHook(hook)
}
Some logrus fields have a special meaning in this hook.
tag
is used as a fluentd tag. (iftag
is omitted, Entry.Message is used as a fluentd tag)