17417: Add arm64 packages for our Golang components.
[arvados.git] / apps / workbench / config / initializers / lograge.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
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|
9     payload = {
10       request_id: event.payload[:request_id],
11     }
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] + "[...]"
20     else
21       payload[:params] = params
22     end
23     payload
24   end
25 end