To debug, write to the error log instead of the response.