From f42d21582890f0152788f1f19853806ff7de1f55 Mon Sep 17 00:00:00 2001 From: Alex Payne Date: Fri, 12 Sep 2014 17:44:28 -0700 Subject: [PATCH] README for Papertrail hook with usage info. --- hooks/papertrail/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 hooks/papertrail/README.md diff --git a/hooks/papertrail/README.md b/hooks/papertrail/README.md new file mode 100644 index 0000000..7ff0564 --- /dev/null +++ b/hooks/papertrail/README.md @@ -0,0 +1,22 @@ +# Papertrail Hook for Logrus + +## Usage + +You can find your Papertrail UDP port on your [Papertrail account page](https://papertrailapp.com/account/destinations). + +```go +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) + } +} +```