write log file