You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm finding that when a program attempts to write to Graylog immediately before it exits (such as a final error message), that message consistently never makes it to Graylog. The goroutines are all cancelled as soon as it exits, so it never finishes.
If github.com/Graylog2/go-gelf could buffer logs and flush periodically to the connection, this slog-graylog lib would be non-blocking without goroutine.
But go-gelf would need a method to flush before program exit as well.
Hello,
In
handler.go
there is a goroutine for writing the message.I'm finding that when a program attempts to write to Graylog immediately before it exits (such as a final error message), that message consistently never makes it to Graylog. The goroutines are all cancelled as soon as it exits, so it never finishes.
Changing this to just:
Does ensure the logs are written. However, I assume it was made into a routine for a reason.
Is there a better way to resolve this?
The text was updated successfully, but these errors were encountered: