added writes to log file when running training