[ARVADOS] updated: 29161e1c68253e4ba4cd59a4b648482e70e24ae9
Git user
git at public.curoverse.com
Thu Sep 1 13:18:29 EDT 2016
Summary of changes:
services/api/config/application.default.yml | 6 ++++++
services/api/config/initializers/lograge.rb | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
via 29161e1c68253e4ba4cd59a4b648482e70e24ae9 (commit)
from 59448e46212f50fc317da51d93309d4e1642b55e (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 29161e1c68253e4ba4cd59a4b648482e70e24ae9
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Sep 1 11:45:20 2016 -0400
Add max_request_log_params_size config (was hardcoded to 1000).
No issue #
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index ed3b517..99d2a10 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -183,6 +183,12 @@ common:
# Default lifetime for ephemeral collections: 2 weeks.
default_trash_lifetime: 1209600
+ # Maximum characters of (JSON-encoded) query parameters to include
+ # in each request log entry. When params exceed this size, they will
+ # be JSON-encoded, truncated to this size, and logged as
+ # params_truncated.
+ max_request_log_params_size: 2000
+
# Maximum size (in bytes) allowed for a single API request. This
# limit is published in the discovery document for use by clients.
# Note: You must separately configure the upstream web server or
diff --git a/services/api/config/initializers/lograge.rb b/services/api/config/initializers/lograge.rb
index e5bd200..4b1aea9 100644
--- a/services/api/config/initializers/lograge.rb
+++ b/services/api/config/initializers/lograge.rb
@@ -5,8 +5,8 @@ Server::Application.configure do
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] + "[...]" }
+ if params_s.length > Rails.configuration.max_request_log_params_size
+ { params_truncated: params_s[0..Rails.configuration.max_request_log_params_size] + "[...]" }
else
{ params: params }
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list