README for Papertrail hook with usage info.

This commit is contained in:
Alex Payne 2014-09-12 17:44:28 -07:00
parent 4c9637c8b4
commit f42d215828
1 changed files with 22 additions and 0 deletions

View File

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