write log file.