Fix output logging.

 - Due to output overwriting, only stdout was logged
 to file.