-
Notifications
You must be signed in to change notification settings - Fork 573
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
[question] How to access with
fields inside a hook
#493
Comments
I ran into the same issue. I'm not sure if this is the most performant way to access it and it would be nice if it were built into the event object. I used reflection to access a readonly copy of the buf variable.
I think the Event object should have a func that returns the string or a map of the buf variable like
|
Because I wound up here from google I would like to add a link for the next person who stumbles across this. Instead of using reflection inside a hook to get at the data, you should consider using an IO.Writer per the example in this comment. |
I'm using a hook to write the logs to graylog using GELF client ( "gopkg.in/Graylog2/go-gelf.v2/gelf")
it appears that there is no way to access with fields
like
I want to add the
k
as extra field (with its value asv
) in GELF message.is there a way we can do this?
The text was updated successfully, but these errors were encountered: