Log SQL before trying api call.