Golang Loggers mapper for New Relic.
See https://gopkg.in/birkirb/loggers.v1
go get github.com/adamhassel/loggers-mapper-newrelic
Assuming you are using loggers in your code, and you want to use loggers for New Relic. Start by configuring your loggers, and then pass it to the mapper and assign it as NewRelic's loggers interface.
package main
import (
"os"
"gopkg.in/birkirb/loggers.v1"
newrelic "github.com/newrelic/go-agent"
nrlog "github.com/adamhassel/loggers-mapper-newrelic"
)
// Log is my default logger.
var Log loggers.Contextual
func main() {
var debug bool
if testing {
debug = true
}
config := newrelic.NewConfig("myappname", license)
logger := nrlog.NewLogger(Log, debug, true)
config.Logger = logger
app, err = newrelic.NewApplication(config)
if err != nil {
panic(err)
}
// ... do new relic transactions
}