Added logfile to store errors that may occur during simulation.