Awesome Go

logrusly

CategoryLogging
SubcategoryLogging
Stars0

[logrus](https://github.com/sirupsen/logrus) plug-in to send errors to a [Loggly](https://www.loggly.com/)

About logrusly

Loggly Hooks for Logrus

Usage

package main

import (
	"github.com/sirupsen/logrus"
	"github.com/sebest/logrusly"
)

var logglyToken string = "YOUR_LOGGLY_TOKEN"

func main() {
	log := logrus.New()
	hook := logrusly.NewLogglyHook(logglyToken, "www.hostname.com", logrus.WarnLevel, "tag1", "tag2")
	log.Hooks.Add(hook)

	log.WithFields(logrus.Fields{
		"name": "joe",
		"age":  42,
	}).Error("Hello world!")

	// Flush is automatic for panic/fatal
	// Just make sure to Flush() before exiting or you may loose up to 5 seconds
	// worth of messages.
	hook.Flush()
}

Frequently Asked Questions

What is logrusly?

logrusly is a Logging library for the Go programming language. [logrus](https://github.com/sirupsen/logrus) plug-in to send errors to a [Loggly](https://www.loggly.com/)

How do I install logrusly?

Install logrusly with the Go module system using `go get sebest/logrusly`. Check the repository for the current installation instructions.

What category does logrusly belong to?

logrusly is listed under Logging, specifically Logging.

← Back to Logging