Added more verbose file logging logic