An adapter of Promtail client for Grafana's Loki logging server server to be used with Logrus logger (written with love and tests).
Take a look at my Promtail client
It's a log hook that handles log messages and translates it to Loki's messages via Prmtail client.
- Logrus hook for centralized logging with Grafana Loki server
- Loki's server health check
- Report about log exchange failures to logrus logger
The easiest way is:
package mypackage
import (
"github.com/ic2hrmk/lokigrus"
"github.com/sirupsen/logrus"
)
func InitPromtailSupport(
logger *logrus.Logger,
lokiAddress string,
appLabels map[string]string,
) error {
promtailHook, err := lokigrus.NewPromtailHook(lokiAddress, appLabels)
if err != nil {
return err
}
logger.AddHook(promtailHook)
return nil
}
Feel free to post a Github Issue, I will respond ASAP