lib/logstash/outputs/scalyr.rb in logstash-output-scalyr-0.1.12 vs lib/logstash/outputs/scalyr.rb in logstash-output-scalyr-0.1.13

- old
+ new

@@ -779,22 +779,22 @@ end status_event[:attrs]['message'] = msg status_event[:attrs]['serverHost'] = @node_hostname status_event[:attrs]['parser'] = @status_parser end + multi_event_request = create_multi_event_request([status_event], nil, nil) + begin + @client_session.post_add_events(multi_event_request[:body], true, 0) + rescue => e + @logger.warn( + "Unexpected error occurred while uploading status to Scalyr", + :error_message => e.message, + :error_class => e.class.name + ) + return + end + @last_status_transmit_time = Time.now() end - multi_event_request = create_multi_event_request([status_event], nil, nil) - begin - @client_session.post_add_events(multi_event_request[:body], true, 0) - rescue => e - @logger.warn( - "Unexpected error occurred while uploading status to Scalyr", - :error_message => e.message, - :error_class => e.class.name - ) - return - end - @last_status_transmit_time = Time.now() if @log_status_messages_to_stdout @logger.info msg end status_event