write log to the file