# frozen_string_literal: true require 'active_support' require 'log_toolbox/log_helper' module LogToolbox module LogPayload extend ActiveSupport::Concern include LogHelper # rubocop:disable Metrics/AbcSize def append_info_to_payload(payload) super payload[:activityID] = request.headers['activityID'] payload[:event_at] = I18n.l(Time.current, format: :timestamp) payload[:service_name] = LogUtil.system_service_name payload[:version] = LogUtil.system_version payload[:origin_ipv4] = request.env['REMOTE_ADDR'] payload[:destination_ipv4] = request.env['SERVER_NAME'] payload[:username] = request.headers['Authorization'] end # rubocop:enable Metrics/AbcSize end end