[ARVADOS] updated: a786d20e2ac2dbc5fd78a6100b23e391ddb3ce32

Git user git at public.curoverse.com
Mon Aug 22 13:07:18 EDT 2016


Summary of changes:
 apps/workbench/Gemfile                        |  3 +++
 apps/workbench/Gemfile.lock                   | 10 ++++++++++
 apps/workbench/config/initializers/lograge.rb | 14 ++++++++++++++
 services/api/Gemfile                          |  2 ++
 services/api/Gemfile.lock                     | 10 ++++++++++
 services/api/config/initializers/lograge.rb   | 14 ++++++++++++++
 6 files changed, 53 insertions(+)
 create mode 100644 apps/workbench/config/initializers/lograge.rb
 create mode 100644 services/api/config/initializers/lograge.rb

       via  a786d20e2ac2dbc5fd78a6100b23e391ddb3ce32 (commit)
       via  69e7b5b364a3e4708325ec214d8d3117095491fd (commit)
       via  4c47283466981a99d27467c086d49a2235f5d0c2 (commit)
       via  9d3c5bef462c95d52ff61693cce49d435461367f (commit)
      from  4b7c0f2aa4da6fdb25419a24d1a7f5b57ab35bfd (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 a786d20e2ac2dbc5fd78a6100b23e391ddb3ce32
Merge: 4b7c0f2 69e7b5b
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Aug 22 13:06:58 2016 -0400

    Merge branch '9818-logstash'
    
    refs #9818
    refs #9709


commit 69e7b5b364a3e4708325ec214d8d3117095491fd
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

commit 4c47283466981a99d27467c086d49a2235f5d0c2
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Aug 18 15:18:45 2016 -0400

    9818: Use lograge/logstash for Workbench request logs.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index e35cc83..db569c9 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -93,3 +93,6 @@ gem "deep_merge", :require => 'deep_merge/rails_compat'
 
 gem 'morrisjs-rails'
 gem 'raphael-rails'
+
+gem 'lograge'
+gem 'logstash-event'
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 2618e47..03bbbce 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -142,6 +142,11 @@ GEM
     logging (2.1.0)
       little-plugger (~> 1.1)
       multi_json (~> 1.10)
+    lograge (0.3.6)
+      actionpack (>= 3)
+      activesupport (>= 3)
+      railties (>= 3)
+    logstash-event (1.2.02)
     mail (2.6.3)
       mime-types (>= 1.16, < 3)
     memoist (0.14.0)
@@ -284,6 +289,8 @@ DEPENDENCIES
   jquery-rails
   less
   less-rails
+  lograge
+  logstash-event
   minitest (>= 5.0.0)
   mocha
   morrisjs-rails
@@ -309,3 +316,6 @@ DEPENDENCIES
   therubyracer
   uglifier (>= 1.0.3)
   wiselinks
+
+BUNDLED WITH
+   1.12.1
diff --git a/apps/workbench/config/initializers/lograge.rb b/apps/workbench/config/initializers/lograge.rb
new file mode 100644
index 0000000..a41384b
--- /dev/null
+++ b/apps/workbench/config/initializers/lograge.rb
@@ -0,0 +1,4 @@
+ArvadosWorkbench::Application.configure do
+  config.lograge.enabled = true
+  config.lograge.formatter = Lograge::Formatters::Logstash.new
+end

commit 9d3c5bef462c95d52ff61693cce49d435461367f
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Aug 18 15:12:03 2016 -0400

    9818: Use lograge to log API requests in logstash format.
    
    Example log line:
    
    {"method":"GET","path":"/arvados/v1/keep_services/accessible","format":"html","controller":"arvados/v1/keep_services","action":"accessible","status":200,"duration":11.07,"view":0.36,"db":2.63,"@timestamp":"2016-08-18T19:04:17Z","@version":"1","message":"[200] GET /arvados/v1/keep_services/accessible (arvados/v1/keep_services#accessible)"}

diff --git a/services/api/Gemfile b/services/api/Gemfile
index 4d03da3..5134fc4 100644
--- a/services/api/Gemfile
+++ b/services/api/Gemfile
@@ -81,3 +81,5 @@ gem 'pg_power'
 gem 'puma'
 gem 'sshkey'
 gem 'safe_yaml'
+gem 'lograge'
+gem 'logstash-event'
diff --git a/services/api/Gemfile.lock b/services/api/Gemfile.lock
index 77e876e..391a26c 100644
--- a/services/api/Gemfile.lock
+++ b/services/api/Gemfile.lock
@@ -112,6 +112,11 @@ GEM
     launchy (2.4.3)
       addressable (~> 2.3)
     libv8 (3.16.14.3)
+    lograge (0.3.6)
+      actionpack (>= 3)
+      activesupport (>= 3)
+      railties (>= 3)
+    logstash-event (1.2.02)
     mail (2.5.4)
       mime-types (~> 1.16)
       treetop (~> 1.4.8)
@@ -237,6 +242,8 @@ DEPENDENCIES
   factory_girl_rails
   faye-websocket
   jquery-rails
+  lograge
+  logstash-event
   mocha
   multi_json
   oj
@@ -259,3 +266,6 @@ DEPENDENCIES
   therubyracer
   trollop
   uglifier (>= 1.0.3)
+
+BUNDLED WITH
+   1.12.1
diff --git a/services/api/config/initializers/lograge.rb b/services/api/config/initializers/lograge.rb
new file mode 100644
index 0000000..50e2e23
--- /dev/null
+++ b/services/api/config/initializers/lograge.rb
@@ -0,0 +1,4 @@
+Server::Application.configure do
+  config.lograge.enabled = true
+  config.lograge.formatter = Lograge::Formatters::Logstash.new
+end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list