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 ClusterID: Rails.configuration.ClusterID,
11 request_id: event.payload[:request_id],
13 # Also log params (minus the pseudo-params added by Rails). But if
14 # params is huge, don't log the whole thing, just hope we get the
15 # most useful bits in truncate(json(params)).
16 exceptions = %w(controller action format id)
17 params = event.payload[:params].except(*exceptions)
18 params_s = Oj.dump(params)
19 if params_s.length > 1000
20 payload[:params_truncated] = params_s[0..1000] + "[...]"
22 payload[:params] = params