sendgridrus is a package exposing a SendGrid hook into Logrus. If your machine doesn't have access to an SMTP port or you just want to use SendGrid, this is a viable option for logging.
By default, sendgridrus hooks will fire on all entries with levels Warning, Error, or Panic.
sendgridrus can be installed using go get:
go get github.com/jnschaeffer/sendgridrusThe simplest way to use sendgridrus is to add it to a Logrus Logger.
import (
"github.com/Sirupsen/logrus"
"github.com/jnschaeffer/sendgridrus"
)
func main() {
log := logrus.New()
hook := sendgridrus.NewHook("SENDGRID API KEY", "SERVICE NAME", "FROM ADDRESS", "TO ADDRESS")
log.Hooks.Add(hook)
}