lib/roda/plugins/common_logger.rb
# Log request/response information in common log format to logger.
Log request/response information in common log format to logger.
Log request / response information in common log format to logger .
def _roda_after_90__common_logger(result)
          return unless result && result[0] && result[1]
          elapsed_time = if timer = @_request_timer
            '%0.4f' % (CommonLogger.start_timer - timer)
          else 
            '-'
          end
          env = @_request.env
          opts[:common_logger_meth].call("#{env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-"} - #{env["REMOTE_USER"] || "-"} [#{Time.now.strftime("%d/%b/%Y:%H:%M:%S %z")}] \"#{env["REQUEST_METHOD"]} #{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}#{"?#{env["QUERY_STRING"]}" if ((qs = env["QUERY_STRING"]) && !qs.empty?)} #{env["HTTP_VERSION"]}\" #{result[0]} #{((length = result[1]['Content-Length']) && (length unless length == '0')) || '-'} #{elapsed_time}\n")
        end
def _roda_after_90__common_logger ( result ) return unless result && result [ 0 ] && result [ 1 ] elapsed_time = if timer = @_request_timer '%0.4f' % ( CommonLogger . start_timer - timer ) else '-' end env = @_request . env opts [ :common_logger_meth ] . call ( "#{env['HTTP_X_FORWARDED_FOR'] || env["REMOTE_ADDR"] || "-"} - #{env["REMOTE_USER"] || "-"} [#{Time.now.strftime("%d/%b/%Y:%H:%M:%S %z")}] \"#{env["REQUEST_METHOD"]} #{env["SCRIPT_NAME"]}#{env["PATH_INFO"]}#{"?#{env["QUERY_STRING"]}" if ((qs = env["QUERY_STRING"]) && !qs.empty?)} #{env["HTTP_VERSION"]}\" #{result[0]} #{((length = result[1]['Content-Length']) && (length unless length == '0')) || '-'} #{elapsed_time}\n" ) end
Log request/response information in common log format to logger.
Log request / response information in common log format to logger .
result