add log, test write file