gemnasium / logrus-graylog-hook

Graylog hook for logrus
MIT License
86 stars 63 forks source link

Not sending to graylog #56

Open iurydias opened 2 years ago

iurydias commented 2 years ago

Hey,

I was trying to create a syncronous hook with no compression and it simply not send to graylog, it just work with assyncronous.

obs: I'm using v3.

graylogHook = graylog.NewGraylogHook(graylogURL, extra)
w := graylogHook.Writer();
if writer, ok := w.(*graylog.UDPWriter); ok {
     writer.CompressionType = graylog.NoCompress
     _ = graylogHook.SetWriter(writer)
}
gravis commented 2 years ago

@iurydias if you change the compression type, a new writer is needed:

https://github.com/gemnasium/logrus-graylog-hook/blob/a6f46d6366e11c4fc143ec5155d8f99c3b35ac83/gelf_writer.go#L234

iurydias commented 1 year ago

@gravis how should I do that? Doing SetWriter() isn't enough, as I did?