feat(middlewares): Add stacktrace in recovery log
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Matthieu 'JP' DERASSE
2023-01-15 19:42:39 +00:00
parent 7bd178c462
commit 2259c587e1
6 changed files with 33 additions and 11 deletions

View File

@ -9,9 +9,8 @@ import (
// ConfigStruct is the configuration for GELF Provider.
type ConfigStruct struct {
Host string `yaml:"host"`
Port int `yaml:"port"`
ExtrasFields map[string]interface{} `yaml:"extra_fields"`
Host string `yaml:"host"`
Port int `yaml:"port"`
}
// IsValid will check that the Gelf configuration is valid.

View File

@ -19,7 +19,7 @@ func NewHook(c *ConfigStruct) (logrus.Hook, error) {
hook := graylog.NewAsyncGraylogHook(
fmt.Sprintf("%s:%d", c.Host, c.Port),
c.ExtrasFields,
nil,
)
defer hook.Flush()