distribution/Godeps/_workspace/src/github.com/Sirupsen/logrus/hooks/papertrail
Stephen J Day 13382e45ba Update logrus dependency
This dependency added a method to access the current standard logger. This is
required to properly configure the logger for context awareness. The plan is to
have all loggers descend from the standard logger.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-02-06 16:20:38 -08:00
..
papertrail.go Update logrus dependency 2015-02-06 16:20:38 -08:00
papertrail_test.go Use Godep to vendor distribution dependencies 2015-01-12 14:01:04 -08:00
README.md Use Godep to vendor distribution dependencies 2015-01-12 14:01:04 -08:00

Papertrail Hook for Logrus :walrus:

Papertrail provides hosted log management. Once stored in Papertrail, you can group your logs on various dimensions, search them, and trigger alerts.

In most deployments, you'll want to send logs to Papertrail via their remote_syslog daemon, which requires no application-specific configuration. This hook is intended for relatively low-volume logging, likely in managed cloud hosting deployments where installing remote_syslog is not possible.

Usage

You can find your Papertrail UDP port on your Papertrail account page. Substitute it below for YOUR_PAPERTRAIL_UDP_PORT.

For YOUR_APP_NAME, substitute a short string that will readily identify your application or service in the logs.

import (
  "log/syslog"
  "github.com/Sirupsen/logrus"
  "github.com/Sirupsen/logrus/hooks/papertrail"
)

func main() {
  log       := logrus.New()
  hook, err := logrus_papertrail.NewPapertrailHook("logs.papertrailapp.com", YOUR_PAPERTRAIL_UDP_PORT, YOUR_APP_NAME)

  if err == nil {
    log.Hooks.Add(hook)
  }
}