-
Notifications
You must be signed in to change notification settings - Fork 4
/
application.rb
71 lines (61 loc) · 2.82 KB
/
application.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require_relative "boot"
require_relative "../app/lib/json_log_formatter"
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_mailbox/engine"
require "action_text/engine"
require "action_view/railtie"
require "action_cable/engine"
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module FormsApi
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.2
# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks])
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
# in config/environments, which are processed later.
#
# config.time_zone = "Central Time (US & Canada)"
# config.eager_load_paths << Rails.root.join("extras")
# Only loads a smaller set of middleware suitable for API only apps.
# Middleware like session, flash, cookies can be added back manually.
# Skip views, helpers and assets when generating a new resource.
config.api_only = true
#### lOGGING #####
# Include generic and useful information about system operation, but avoid logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII).
config.log_level = :info
# Use JSON log formatter for better support in Splunk. To use conventional
# logging use the Logger::Formatter.new.
config.log_formatter = JsonLogFormatter.new
# Lograge is used to format the standard HTTP request logging
config.lograge.enabled = true
config.lograge.formatter = Lograge::Formatters::Json.new
config.lograge.custom_options = lambda do |event|
{}.tap do |h|
h[:host] = event.payload[:host]
h[:request_id] = event.payload[:request_id]
h[:requested_by] = event.payload[:requested_by] if event.payload[:requested_by]
h[:form_id] = event.payload[:form_id] if event.payload[:form_id]
h[:page_id] = event.payload[:page_id] if event.payload[:page_id]
h[:params] = event.payload[:params].except(:controller, :action)
h[:exception] = event.payload[:exception] if event.payload[:exception]
h[:trace_id] = event.payload[:trace_id] if event.payload[:trace_id]
end
end
end
end