fix tag name to be included

This commit is contained in:
Marek Goc 2024-11-14 17:37:25 +01:00
parent deb7986cad
commit 280fbdda84

View File

@ -23,8 +23,6 @@ type GELFMessage struct {
// All additional field names must start with an underline. // All additional field names must start with an underline.
ExtraFields map[string]interface{} `json:"extrafields,omitempty"` ExtraFields map[string]interface{} `json:"extrafields,omitempty"`
Tag string `json:"tag,omitempty"`
} }
func Log(writer *gelf.UDPWriter, msg GELFMessage) { func Log(writer *gelf.UDPWriter, msg GELFMessage) {
@ -40,7 +38,6 @@ func Log(writer *gelf.UDPWriter, msg GELFMessage) {
func (g GELFMessage) GELFFormat() *gelf.Message { func (g GELFMessage) GELFFormat() *gelf.Message {
prefixedExtras := make(map[string]interface{}, len(g.ExtraFields)) prefixedExtras := make(map[string]interface{}, len(g.ExtraFields))
prefixedExtras["tag"] = g.Tag
for k, v := range g.ExtraFields { for k, v := range g.ExtraFields {
prefixedExtras["_"+k] = v prefixedExtras["_"+k] = v
} }