summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Leff <adam@leff.co>2016-11-21 15:31:25 -0500
committerAdam Leff <adam@leff.co>2016-11-21 15:36:54 -0500
commit539696886570ec2a82cdb1bb684a383ce683f88e (patch)
treed16a98fb998035eea41b94f9fa6cf5ea4b396b63
parentb488d5ba2afec65939cb4a267151fd26a21b3d1a (diff)
downloadchef-adamleff/data_collector_debug_log.tar.gz
Data Collector debug log should output JSONadamleff/data_collector_debug_log
After changing Data Collector to use Chef::ServerAPI or Chef::HTTP::SimpleJSON, the message output in the debug log is a ruby inspect of the message hash rather than the JSON output that will be sent to the data collector. Having this as JSON makes it easier to debug and reproduce Data Collector-related issues. Signed-off-by: Adam Leff <adam@leff.co>
-rw-r--r--lib/chef/data_collector.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/data_collector.rb b/lib/chef/data_collector.rb
index 82c41edfdc..102dfbdf64 100644
--- a/lib/chef/data_collector.rb
+++ b/lib/chef/data_collector.rb
@@ -331,7 +331,7 @@ class Chef
def send_to_data_collector(message)
return unless data_collector_accessible?
- Chef::Log.debug("data_collector_reporter: POSTing the following message to #{data_collector_server_url}: #{message}")
+ Chef::Log.debug("data_collector_reporter: POSTing the following message to #{data_collector_server_url}: #{Chef::JSONCompat.to_json(message)}")
http.post(nil, message, headers)
end