lib/falcon/verbose.rb in falcon-0.13.1 vs lib/falcon/verbose.rb in falcon-0.14.0

- old
+ new

@@ -30,12 +30,12 @@ end def annotate(request, peer: nil, address: nil) task = Async::Task.current - # @logger.debug "#{request.method} #{request.path} #{request.version} from #{address.inspect}" - # @logger.debug request.headers.inspect + @logger.debug(request.authority) {"#{request.method} #{request.path} #{request.version} from #{address.inspect}"} + @logger.debug(request.authority) {request.headers.inspect} task.annotate("#{request.method} #{request.path} from #{address.inspect}") end def call(request, **options) @@ -44,12 +44,12 @@ statistics = Async::HTTP::Statistics.start response = super statistics.wrap(response) do |statistics, error| - @logger.info "#{request.method} #{request.path} #{request.version} -> #{response.status}; #{statistics.inspect}" + @logger.info(request.authority) {"#{request.method} #{request.path} #{request.version} -> #{response.status}; #{statistics.inspect}"} # @logger.info response.headers.inspect - @logger.error "#{error.class}: #{error.message}" if error + @logger.error(request.authority) {"#{error.class}: #{error.message}"} if error end return response end end