Sha256: 57e1ecb63ca173c11ef5a49a25dbe64292fbec42c3b7ad0bf433967c5aed609e

Contents?: true

Size: 688 Bytes

Versions: 4

Compression:

Stored size: 688 Bytes

Contents

require 'justlogging'

module Justlogging
  class Railtie < Rails::Railtie

    initializer "justlogging.configure_rails_initialization" do |app|
      app.middleware.insert_after ActionDispatch::DebugExceptions, Justlogging::Middleware

      Justlogging.subscriber = ActiveSupport::Notifications.subscribe do |*args|
        if Justlogging::Transaction.current
          event = ActiveSupport::Notifications::Event.new(*args)
          if event.name == 'process_action.action_controller'
            Justlogging::Transaction.current.set_log_entry(event)
          else
            Justlogging::Transaction.current.add_event(event)
          end
        end
      end
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
justlogging-rails-0.0.5 lib/justlogging/railtie.rb
justlogging-rails-0.0.4 lib/justlogging/railtie.rb
justlogging-rails-0.0.3 lib/justlogging/railtie.rb
justlogging-rails-0.0.2 lib/justlogging/railtie.rb