aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/railties/subscriber.rb
blob: cdb1162eac77e8b2ff706fab7f22478bc9d30367 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module ActionDispatch
  module Railties
    class Subscriber < Rails::Subscriber
      def before_dispatch(event)
        request = Request.new(event.payload[:env])
        path    = request.request_uri.inspect rescue "unknown"

        info "\n\nStarted #{request.method.to_s.upcase} #{path} " <<
             "for #{request.remote_ip} at #{event.time.to_s(:db)}"
      end

      def logger
        ActionController::Base.logger
      end
    end
  end
end