Permalink
Browse files

Improve performance of the Logger middleware by using simpler version…

…s of methods
  • Loading branch information...
1 parent 8b05c52 commit 67a2d648d88f8520612fd7b01fcc7223290aac75 @wycats wycats committed Jun 4, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 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 @@ def call(env)
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)

0 comments on commit 67a2d64

Please sign in to comment.