Module: ZuoraObservability::Logging::CustomOptions
- Defined in:
- lib/zuora_observability/logging/custom_options.rb
Overview
Custom Options for lograge to add additional fields to logged data
Constant Summary collapse
- IGNORE_HEADERS =
%w[ RAW_POST_DATA REQUEST_METHOD REQUEST_URI REQUEST_PATH PATH_INFO CONTENT_TYPE ORIGINAL_FULLPATH QUERY_STRING HTTP_COOKIE ].freeze
- IGNORE_PARAMS =
%w[controller action format].freeze
- FILTERED =
'[FILTERED]'
Class Method Summary collapse
Class Method Details
.call(event) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/zuora_observability/logging/custom_options.rb', line 24 def call(event) items = { msg: 'Rails Request', params: event.payload[:params].as_json(except: IGNORE_PARAMS).to_s, zuora_trace_id: event.payload[:headers]['HTTP_ZUORA_REQUEST_ID'], error: event.payload[:exception_object] } if event.payload[:headers].present? request_headers = filter_request_headers(event.payload[:headers]) filtered_headers = filter_sensitive_headers(request_headers) items.merge!({ headers: filtered_headers }) end items end |