towrite logfile