graylog-labs / gelf-rb

Ruby GELF library (Graylog Extended Log Format)
https://rubygems.org/gems/gelf
MIT License
153 stars 104 forks source link

Handle connection failed #84

Open KevDBG opened 5 years ago

KevDBG commented 5 years ago

Hello,

The fluentd plugin https://github.com/emsearcy/fluent-plugin-gelf use gelf-rb.

We have a case, when we tried to start fluentd and the graylog server is not reachable.

We have this problem -> https://github.com/emsearcy/fluent-plugin-gelf/issues/28

Is-it possible to handle this exception in your code to let fluentd start and return a specific message or code.

Next, the plugin could handle this situation and try again the connection.

Thanks,

thg303 commented 4 years ago

It happens with graylog connection too. It should not crash the whole rails app because of a third party crash/absence.

evangallup commented 4 years ago

For anyone else that stumbles across this issue from a google search.

I ended up changing to UDP to resolve this issue and it seems to correct it. Not getting any rails crashes with a disconnect from graylog. I understand there are reasons you would want to use TCP (security namely), but for our use case it solves the issue.

breisig commented 3 years ago

We noticed the same issue here. When using TCP mode to connect to Graylog. If we reboot the Graylog server, Our rails app continuously crashes until the Graylog is back up. But when using UDP mode, the rails app stays up and doesn't crash wither the Graylog server is up or down.