Skip to content

Commit

Permalink
Merge pull request #10 from smira/fix-exceptions
Browse files Browse the repository at this point in the history
Fix incorrect statement split, use more relaxed JSON encoder
  • Loading branch information
Yoichi Kawasaki committed Jul 31, 2019
2 parents 43b4b7a + ab482e8 commit f61cb7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions fluent-plugin-azure-loganalytics.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Gem::Specification.new do |gem|

gem.add_dependency "fluentd", [">= 0.14.15", "< 2"]
gem.add_dependency "rest-client"
gem.add_dependency "yajl-ruby"
gem.add_dependency "azure-loganalytics-datacollector-api", [">= 0.1.5"]
gem.add_development_dependency "bundler", "~> 1.11"
gem.add_development_dependency "rake", "~> 10.0"
Expand Down
8 changes: 4 additions & 4 deletions lib/fluent/plugin/out_azure-loganalytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def write(chunk)
begin
res = @client.post_data(@log_type, records, @time_generated_field)
if not Azure::Loganalytics::Datacollectorapi::Client.is_success(res)
log.fatal "DataCollector API request failure: error code: "
+ "#{res.code}, data=>" + records.to_json
log.fatal "DataCollector API request failure: error code: " +
"#{res.code}, data=>" + Yajl.dump(records)
end
rescue Exception => ex
log.fatal "Exception occured in posting to DataCollector API: "
+ "'#{ex}', data=>" + records.to_json
log.fatal "Exception occured in posting to DataCollector API: " +
"'#{ex}', data=>" + Yajl.dump(records)
end
end
end
Expand Down

0 comments on commit f61cb7e

Please sign in to comment.