Skip to content

About

SendGrid hooks for Logrus

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

sendgridrus - SendGrid hook into Logrus

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.

Installation

sendgridrus can be installed using go get:

go get github.com/jnschaeffer/sendgridrus

Usage

The 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)
}

About

SendGrid hooks for Logrus

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

⌂ 换网址