Improving logging when response bodies are not valid JSON