[ARVADOS] created: 104f1d0e5be4672284cab41f56da41fa695b391e
Git user
git at public.curoverse.com
Thu Aug 18 15:13:43 EDT 2016
at 104f1d0e5be4672284cab41f56da41fa695b391e (commit)
commit 104f1d0e5be4672284cab41f56da41fa695b391e
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Aug 18 15:12:03 2016 -0400
9818: Use lograge to log queries 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