[question] How to access `with` fields inside a hook
Author: vijayrajahCreated Oct 11, 2022Updated Apr 22, 2026
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
log.With().Str("k","v).Logger().Info().Msg("some message")I want to add the k as extra field (with its value as v) in GELF message.
is there a way we can do this?
Source: rs/zerolog