Fix sql quoting for log lines