diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-17 12:41:55 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-17 12:43:17 +0100 |
commit | 27d9836ad3519d57462b86a4e539c1aa176b6d95 (patch) | |
tree | 8a228e43b44285ab7fd3a63d8908fbe4469d3a1e /actionpack/lib/action_dispatch/railties | |
parent | 61ada28ed3cdc42efa6f9714e909231959b88c26 (diff) | |
download | rails-27d9836ad3519d57462b86a4e539c1aa176b6d95.tar.gz rails-27d9836ad3519d57462b86a4e539c1aa176b6d95.tar.bz2 rails-27d9836ad3519d57462b86a4e539c1aa176b6d95.zip |
Add ActionDispatch::Railties::Subscriber and finish tidying up the logging.
Diffstat (limited to 'actionpack/lib/action_dispatch/railties')
-rw-r--r-- | actionpack/lib/action_dispatch/railties/subscriber.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/railties/subscriber.rb b/actionpack/lib/action_dispatch/railties/subscriber.rb new file mode 100644 index 0000000000..c08a844c6a --- /dev/null +++ b/actionpack/lib/action_dispatch/railties/subscriber.rb @@ -0,0 +1,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\nProcessing #{path} to #{request.formats.join(', ')} " << + "(for #{request.remote_ip} at #{event.time.to_s(:db)}) [#{request.method.to_s.upcase}]" + end + + def logger + ActionController::Base.logger + end + end + end +end
\ No newline at end of file |