log url and body to external file with appendfile when error