Star us on GitHub
Star
Menu

logrus

Learn how to set up highlight.io Go logrus log ingestion.
1
Set up your frontend and backend highlight.io integration.

First, make sure you've followed the frontend getting started and backend getting started guides.

2
Add the Highlight logrus hook.

hlog.NewHook is the highlight Logrus hook.

import ( hlog "github.com/highlight/highlight/sdk/highlight-go/log" "github.com/sirupsen/logrus" ) func main() { // ... // setup the highlight logrus hook for all desired log levels logrus.AddHook(hlog.NewHook(hlog.WithLevels( logrus.PanicLevel, logrus.FatalLevel, logrus.ErrorLevel, logrus.WarnLevel, logrus.InfoLevel, ))) // ... }
Copy
3
Verify your backend logs are being recorded.

Visit the highlight logs portal and check that backend logs are coming in.