Handle exceptions when getting log file.