def execute_with_rails_logging(client, request_context)
body = (request_context[:data]||"").dup
action = request_context[:path].capitalize
if body =~ COMMIT
action = "Commit"
body = ""
end
response = nil
begin
ms = Benchmark.ms do
response = execute_without_rails_logging(client, request_context)
end
log_name = 'Solr %s (%.1fms)' % [action, ms]
::Rails.logger.debug(format_log_entry(log_name, body))
rescue Exception => e
log_name = 'Solr %s (Error)' % [action]
::Rails.logger.error(format_log_entry(log_name, body))
raise e
end
response
end