Sha256: 488e96c13873eb646c607de891d839b3ee1aac66cc788338aff358ba116d03c7

Contents?: true

Size: 703 Bytes

Versions: 1

Compression:

Stored size: 703 Bytes

Contents

# frozen_string_literal: true

require 'active_support'

module LogToolbox
  module LogPayload
    extend ActiveSupport::Concern
    include LogHelper

    # rubocop:disable Metrics/AbcSize
    def append_info_to_payload(payload)
      super
      payload[:id] = request.headers['correlation_id']
      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

1 entries across 1 versions & 1 rubygems

Version Path
log_toolbox-1.0.0 lib/log_toolbox/log_payload.rb