Skip to content

Commit

Permalink
updated imports and readme for standardizing paths #8
Browse files Browse the repository at this point in the history
  • Loading branch information
undiabler committed Apr 13, 2017
1 parent 3ffa973 commit d1e9df1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,32 @@ In most deployments, you'll want to send logs to Papertrail via their [remote_sy

You can find your Papertrail port(Accepting TCP/TLS, UDP) on your [Papertrail account page](https://papertrailapp.com/account/destinations). Substitute it below for `YOUR_PAPERTRAIL_PORT`.

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

### Note

If you see case-sensitive problems you should read [this issue](https://github.com/sirupsen/logrus/issues/451) and [this](https://github.com/polds/logrus-papertrail-hook/issues/8)
We should fix this in future if real path of logrus repo will changed. For now you can use gopkg import: `gopkg.in/polds/logrus-papertrail-hook.v2`

For `YOUR_APP_NAME` and `YOUR_HOST_NAME`, substitute a short strings that will readily identify your application and server in the logs.
If you leave `YOUR_HOST_NAME` empty, papertrail will replace it with your ip.

```go
import (
"log/syslog"
"github.com/sirupsen/logrus"
log "github.com/Sirupsen/logrus"
"github.com/polds/logrus-papertrail-hook"
)

func main() {
log := logrus.New()

hook, err := logrus_papertrail.NewPapertrailHook(&logrus_papertrail.Hook{
Host: "logs.papertrailapp.com",
Port: YOUR_PAPERTRAIL_PORT,
Hostname: YOUR_HOST_NAME,
Appname: YOUR_APP_NAME
})

hook.SetLevels([]log.Level{log.ErrorLevel, log.WarnLevel})

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

log.Warning("Here is you message")

}
```

Expand All @@ -44,4 +43,4 @@ func main() {
- [gopkg.in/polds/logrus-papertrail-hook.v2](https://godoc.org/gopkg.in/polds/logrus-papertrail-hook.v2)
- Adds support for custom hostnames. Major API change.
- [gopkg.in/polds/logrus-papertrail-hook.v3](https://godoc.org/gopkg.in/polds/logrus-papertrail-hook.v3)
- Major update implementing new features. May case case sensetive errors, for more info see [this issue](https://github.com/sirupsen/logrus/issues/451)
- Low case path. Read more [here](https://github.com/polds/logrus-papertrail-hook/issues/8) and [here](https://github.com/sirupsen/logrus/issues/451)
2 changes: 1 addition & 1 deletion papertrail.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"time"

"github.com/sirupsen/logrus"
"github.com/Sirupsen/logrus"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion papertrail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/sirupsen/logrus"
"github.com/Sirupsen/logrus"
"github.com/stvp/go-udp-testing"
)

Expand Down

0 comments on commit d1e9df1

Please sign in to comment.