Sha256: fa836eaaf5559d8c48768eaf30d98a381987097e4605a90e773905a277801119

Contents?: true

Size: 740 Bytes

Versions: 4

Compression:

Stored size: 740 Bytes

Contents

# 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.now, 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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
log_toolbox-1.3.2 lib/log_toolbox/log_payload.rb
log_toolbox-1.3.1 lib/log_toolbox/log_payload.rb
log_toolbox-1.3.0 lib/log_toolbox/log_payload.rb
log_toolbox-1.2.0 lib/log_toolbox/log_payload.rb