import oopslogrus "github.com/samber/oops/loggers/logrus"
func init() {
logrus.SetFormatter(
oopslogrus.NewOopsFormatter(
&logrus.JSONFormatter{},
)
)
}
func main() {
err := oops.
With("driver", "postgresql").
With("query", query).
With("query.duration", queryDuration).
Errorf("could not fetch user")
if err != nil {
logrus.WithError(err).Error(err)
}
}
logrus
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||