lib/logstash/outputs/graphite.rb in logstash-output-graphite-3.1.5 vs lib/logstash/outputs/graphite.rb in logstash-output-graphite-3.1.6
- old
+ new
@@ -128,10 +128,15 @@
# Catch exceptions like ECONNRESET and friends, reconnect on failure.
# TODO(sissel): Test error cases. Catch exceptions. Find fortune and glory.
begin
@socket.puts(message)
rescue Errno::EPIPE, Errno::ECONNRESET, IOError => e
- @logger.warn("Connection to graphite server died", :exception => e, :host => @host, :port => @port)
+ @logger.warn("Connection to graphite server died", :exception => e.class, :message => e.message, :host => @host, :port => @port)
+ sleep(@reconnect_interval)
+ connect
+ retry if @resend_on_failure
+ rescue => e
+ @logger.warn("Failed to send data", :exception => e.class, :message => e.message, :host => @host, :port => @port)
sleep(@reconnect_interval)
connect
retry if @resend_on_failure
end
end