Sha256: 2e6c1df44f859d4637f314701e2c36d5e90c289954569081e33bad632dd41443

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

require 'rails'
require 'lograge'

module Metova
  module Logger
    class Railtie < ::Rails::Railtie
      initializer "metova.logger" do |_|

        config.log_tags = [
          lambda { |request| request.uuid[0..15] }
        ]

        config.lograge.enabled = true
        config.lograge.custom_options = lambda do |event|
          {
            time: event.time,
            user: event.payload[:user],
            ip: event.payload[:ip],
          }
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metova-logger-0.0.1 lib/metova/logger/railtie.rb