1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 ArvadosWorkbench::Application.configure do
6 config.lograge.enabled = true
7 config.lograge.formatter = Lograge::Formatters::Logstash.new
8 config.lograge.custom_options = lambda do |event|
10 request_id: event.payload[:request_id],
12 # Also log params (minus the pseudo-params added by Rails). But if
13 # params is huge, don't log the whole thing, just hope we get the
14 # most useful bits in truncate(json(params)).
15 exceptions = %w(controller action format id)
16 params = event.payload[:params].except(*exceptions)
17 params_s = Oj.dump(params)
18 if params_s.length > 1000
19 payload[:params_truncated] = params_s[0..1000] + "[...]"
21 payload[:params] = params