Skip to content

Commit

Permalink
fix request logging
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeevit committed Jun 7, 2020
1 parent 1b0dd56 commit 2bbdbd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/puma/error_logger.rb
Expand Up @@ -63,7 +63,7 @@ def title(options={})

string_block = ["#{Time.now}"]
string_block << " #{text}" if text
string_block << " (#{request_title(req)})" if req
string_block << " (#{request_title(req)})" if request_parsed?(req)
string_block << ": #{error.inspect}" if error
string_block.join('')
end
Expand All @@ -88,5 +88,9 @@ def request_headers(req)
headers = req.env.select { |key, _| key.start_with?('HTTP_') }
headers.map { |key, value| [key[5..-1], value] }.to_h.inspect
end

def request_parsed?(req)
req && req.env[REQUEST_METHOD]
end
end
end

0 comments on commit 2bbdbd2

Please sign in to comment.