timeout is now configurable and documented

This commit is contained in:
Roberto Bampi
2014-11-25 13:36:08 +01:00
parent 383ab1fb69
commit 5df4b882d0
2 changed files with 35 additions and 11 deletions
+19
View File
@@ -40,3 +40,22 @@ When logs are sent to sentry these fields are treated differently.
is logging the event (hostname.example.com)
- logger is the part of the application which is logging the event.
In go this usually means setting it to the name of the package.
## Timeout
`Timeout` is the time the sentry hook will wait for a response
from the sentry server.
If this time elapses with no response from
the server an error will be returned.
If `Timeout` is set to 0 the SentryHook will not wait for a reply
and will assume a correct delivery.
The SentryHook has a default timeout of `100 milliseconds` when created
with a call to `NewSentryHook`. This can be changed by assigning a value to the `Timeout` field:
```go
hook, _ := logrus_sentry.NewSentryHook(...)
hook.Timeout = 20*time.Seconds
```