Add code in write_to_logfile() to account for missing logs/ directory