Skip to content

Commit

Permalink
Merge pull request #621 from palexander/patch-1
Browse files Browse the repository at this point in the history
Add colon to match common logger spec
  • Loading branch information
spastorino committed Nov 19, 2013
2 parents df1506b + 65f75b4 commit 38d788d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rack/commonlogger.rb
Expand Up @@ -46,7 +46,7 @@ def log(env, status, header, began_at)
logger.write FORMAT % [
env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-",
env["REMOTE_USER"] || "-",
now.strftime("%d/%b/%Y %H:%M:%S %z"),
now.strftime("%d/%b/%Y:%H:%M:%S %z"),
env["REQUEST_METHOD"],
env["PATH_INFO"],
env["QUERY_STRING"].empty? ? "" : "?"+env["QUERY_STRING"],
Expand Down
2 changes: 1 addition & 1 deletion test/spec_commonlogger.rb
Expand Up @@ -67,7 +67,7 @@ def with_mock_time(t = 0)
md = /- - - \[([^\]]+)\] "(\w+) \/ " (\d{3}) \d+ ([\d\.]+)/.match(log.string)
md.should.not.equal nil
time, method, status, duration = *md.captures
time.should.equal Time.at(0).strftime("%d/%b/%Y %H:%M:%S %z")
time.should.equal Time.at(0).strftime("%d/%b/%Y:%H:%M:%S %z")
method.should.equal "GET"
status.should.equal "200"
(0..1).should.include?(duration.to_f)
Expand Down

0 comments on commit 38d788d

Please sign in to comment.