Backend: Error Monitoring
Go
JS
Python
Backend: Logging
Fullstack Frameworks
Next.JS
Self Host & Local Dev
Menu
logrus
Learn how to set up highlight.io Go logrus log ingestion.
1
Set up your frontend highlight.io integration.
First, make sure you've followed the frontend getting started guide.
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,
)))
// ...
}
3
Verify your backend logs are being recorded.
Visit the highlight logs portal and check that backend logs are coming in.