[ARVADOS] updated: e087fc478cf6f5a1d378da554df37ce55ac38e29

Git user git at public.curoverse.com
Thu Aug 18 16:52:37 EDT 2016


Summary of changes:
 apps/workbench/config/initializers/lograge.rb | 10 ++++++++++
 services/api/config/initializers/lograge.rb   | 10 ++++++++++
 2 files changed, 20 insertions(+)

       via  e087fc478cf6f5a1d378da554df37ce55ac38e29 (commit)
      from  eaa231c626dbb6cd21a667412d79baef2d0c5885 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e087fc478cf6f5a1d378da554df37ce55ac38e29
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Aug 18 16:47:19 2016 -0400

    9818: Log params when small, first 1K of json-encoded params when big.

diff --git a/apps/workbench/config/initializers/lograge.rb b/apps/workbench/config/initializers/lograge.rb
index a41384b..24252c8 100644
--- a/apps/workbench/config/initializers/lograge.rb
+++ b/apps/workbench/config/initializers/lograge.rb
@@ -1,4 +1,14 @@
 ArvadosWorkbench::Application.configure do
   config.lograge.enabled = true
   config.lograge.formatter = Lograge::Formatters::Logstash.new
+  config.lograge.custom_options = lambda do |event|
+    exceptions = %w(controller action format id)
+    params = event.payload[:params].except(*exceptions)
+    params_s = Oj.dump(params)
+    if params_s.length > 1000
+      { params_truncated: params_s[0..1000] + "[...]" }
+    else
+      { params: params }
+    end
+  end
 end
diff --git a/services/api/config/initializers/lograge.rb b/services/api/config/initializers/lograge.rb
index 50e2e23..e5bd200 100644
--- a/services/api/config/initializers/lograge.rb
+++ b/services/api/config/initializers/lograge.rb
@@ -1,4 +1,14 @@
 Server::Application.configure do
   config.lograge.enabled = true
   config.lograge.formatter = Lograge::Formatters::Logstash.new
+  config.lograge.custom_options = lambda do |event|
+    exceptions = %w(controller action format id)
+    params = event.payload[:params].except(*exceptions)
+    params_s = Oj.dump(params)
+    if params_s.length > 1000
+      { params_truncated: params_s[0..1000] + "[...]" }
+    else
+      { params: params }
+    end
+  end
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list