Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove references to UDP logrus hook from README #108

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,45 +28,6 @@ func main() {
}
```

### Emit structured logs to Elastic search using udpbeat

**Add trace's document template to your ElasticSearch cluster**

```shell
curl -XPUT 'http://localhost:9200/_template/trace' -d@udbbeat/template.json
```

**Start udpbeat UDP logs collector and emitter**

```shell
go get github.com/gravitational/udpbeat
udpbeat
```

**Hook up logger to UDP collector**

In your code, attach a logrus hook to use udpbeat:

```golang

import (
"github.com/gravitational/trace"
log "github.com/sirupsen/logrus"
)

func main() {
hook, err := trace.NewUDPHook()
if err != nil {
log.Fatalf(err)
}
log.SetHook(hook)
}
```

Done! You will get structured logs capturing output, log and error message.
You can edit `udpbeat/template.json` to modify emitted fields to whatever makes sense to your app.





Loading