lib/falcon/verbose.rb in falcon-0.19.5 vs lib/falcon/verbose.rb in falcon-0.19.6
- old
+ new
@@ -31,16 +31,12 @@
def annotate(request)
task = Async::Task.current
address = request.remote_address
- @logger.debug(request.authority) {"#{request.method} #{request.path} #{request.version} from #{address.inspect}"}
+ @logger.info(request.authority) {"#{request.method} #{request.path} #{request.version} #{request.headers.to_h} from #{address.inspect}"}
- # if ENV['REQUEST_HEADERS']
- # @logger.debug(request.authority) {request.headers.inspect}
- # end
-
task.annotate("#{request.method} #{request.path} from #{address.inspect}")
end
def call(request)
annotate(request)
@@ -48,14 +44,10 @@
statistics = Async::HTTP::Statistics.start
response = super
statistics.wrap(response) do |statistics, error|
- @logger.info(request.authority) {"#{request.method} #{request.path} #{request.version} -> #{response.status}; #{statistics.inspect}"}
-
- # if ENV['RESPONSE_HEADERS']
- # @logger.info response.headers.inspect
- # end
+ @logger.info(request.authority) {"#{statistics.object_id}] #{request.method} #{request.path} #{request.version} -> #{response.status} #{response.headers.to_h}; #{statistics.inspect}"}
@logger.error(request.authority) {"#{error.class}: #{error.message}"} if error
end
return response