tree: feed0ac29143d0a0b28523f0b42648cca9fc86a4 [path history] [tgz]
  2. papertrail.go
  3. papertrail_test.go

Papertrail Hook for Logrus

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.


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 (

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

  if err == nil {