logrus/hooks/papertrail
Alex Payne f42d215828 README for Papertrail hook with usage info. 2014-09-12 17:44:28 -07:00
..
README.md README for Papertrail hook with usage info. 2014-09-12 17:44:28 -07:00
papertrail.go Papertrail hook, uses their UDP interface. 2014-09-12 17:40:09 -07:00
papertrail_test.go Papertrail hook, uses their UDP interface. 2014-09-12 17:40:09 -07:00

README.md

Papertrail Hook for Logrus

Usage

You can find your Papertrail UDP port on your Papertrail account page.

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