logfile will be written while logging