aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/rack
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-06-04 09:49:25 -0700
committerwycats <wycats@gmail.com>2010-06-04 20:11:05 -0700
commit67a2d648d88f8520612fd7b01fcc7223290aac75 (patch)
tree2e58c497278e706dcbb1d7ae67c6765503533914 /railties/lib/rails/rack
parent8b05c5207dd5757d55d0c384740db289e6bd5415 (diff)
downloadrails-67a2d648d88f8520612fd7b01fcc7223290aac75.tar.gz
rails-67a2d648d88f8520612fd7b01fcc7223290aac75.tar.bz2
rails-67a2d648d88f8520612fd7b01fcc7223290aac75.zip
Improve performance of the Logger middleware by using simpler versions of methods
Diffstat (limited to 'railties/lib/rails/rack')
-rw-r--r--railties/lib/rails/rack/logger.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/railties/lib/rails/rack/logger.rb b/railties/lib/rails/rack/logger.rb
index dd8b342f59..73e9af3b41 100644
--- a/railties/lib/rails/rack/logger.rb
+++ b/railties/lib/rails/rack/logger.rb
@@ -1,4 +1,5 @@
require 'rails/log_subscriber'
+require 'active_support/core_ext/time/conversions'
module Rails
module Rack
@@ -19,10 +20,10 @@ module Rails
def before_dispatch(env)
request = ActionDispatch::Request.new(env)
- path = request.fullpath.inspect rescue "unknown"
+ path = request.fullpath
- info "\n\nStarted #{request.method.to_s.upcase} #{path} " <<
- "for #{request.remote_ip} at #{Time.now.to_s(:db)}"
+ info "\n\nStarted #{env["REQUEST_METHOD"]} \"#{path}\" " \
+ "for #{request.ip} at #{Time.now.to_default_s}"
end
def after_dispatch(env)