Sha256: 3d723eca7ce3c28eb5db0dfcaf38d1837afaf7591cff9cb8461034729bfc8210

Contents?: true

Size: 836 Bytes

Versions: 2

Compression:

Stored size: 836 Bytes

Contents

# frozen_string_literal: true

require 'lograge'

if Rails.env.staging? || Rails.env.production?
  Rails.application.configure do
    config.colorize_logging = false

    config.lograge.enabled = true
    config.lograge.formatter = ::Lograge::Formatters::Raw.new
    config.lograge.base_controller_class = [
      'ActionController::API',
      'ActionController::Base'
    ]

    config.lograge.ignore_actions = ['EIVO::StatusController#index']

    config.lograge.custom_options = ->(event) do
      result = event.payload || {}

      if result[:params]
        result[:params] = result[:params].except('controller', 'action', 'format')
      end

      # https://github.com/roidrage/lograge/pull/307
      if event.respond_to?(:allocations)
        result[:allocations] = event.allocations
      end

      result
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
eivo-rails-api-0.1.12 config/initializers/logger.rb
eivo-rails-0.1.11 config/initializers/logger.rb