Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.18 KB

README.md

File metadata and controls

46 lines (32 loc) · 1.18 KB

rollbar

Build Status codecov Go Report Card GoDoc

Middleware to integrate with rollbar error monitoring. It uses roll client for Go that reports errors and logs messages.

Usage

Start using it

Download and install it:

$ go get github.com/easonlin404/rollbar

Import it in your code:

import "github.com/easonlin404/rollbar"

Example

package main

import (
	"github.com/easonlin404/rollbar"
	"github.com/gin-gonic/gin"
	"github.com/stvp/roll"
)

func main() {
	roll.Token = "POST_SERVER_ITEM_ACCESS_TOKEN"
	//roll.Environment = "production" // defaults to "development"

	r := gin.Default()
	r.Use(rollbar.Recovery(true))

	r.Run(":8080")
}