Updated logFile() function to better handle file searching